Date filter can't format date/time with newlines #15794
Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Using a date format containing a newline is treated as though the format ended at the newline.
i.e. | date: 'dd MMM\nyyyy'
is treated as though it were | date: 'dd MMM'
Plunkers: Angular 1.5.10, Angular 1.6.3, Angular 2.unknown
What is the expected behavior?
The format string should be processed in its entirety.
What is the motivation / use case for changing the behavior?
A UI design required a timestamp to be formatted with date and time separated by a newline. This should be as simple as | date: 'yyyy-MM-dd\nHH:mm'
(assuming an appropriate CSS white-space
value.)
Which versions of AngularJS, and which browser / OS are affected by this issue? Did this work in previous versions of AngularJS? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
Appears to affect all versions of since at least March 2012, including angular 2
Other information (e.g. stacktraces, related issues, suggestions how to fix)
Fix in pull request #15792