File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -475,7 +475,7 @@ var DATE_FORMATS = {
475
475
GGGG : longEraGetter
476
476
} ;
477
477
478
- var DATE_FORMATS_SPLIT = / ( (?: [ ^ y M L d H h m s a Z E w G ' ] + ) | (?: ' (?: [ ^ ' ] | ' ' ) * ' ) | (?: E + | y + | M + | L + | d + | H + | h + | m + | s + | a | Z | G + | w + ) ) ( . * ) / ,
478
+ var DATE_FORMATS_SPLIT = / ( (?: [ ^ y M L d H h m s a Z E w G ' ] + ) | (?: ' (?: [ ^ ' ] | ' ' ) * ' ) | (?: E + | y + | M + | L + | d + | H + | h + | m + | s + | a | Z | G + | w + ) ) ( [ \s \S ] * ) / ,
479
479
NUMBER_STRING = / ^ - ? \d + $ / ;
480
480
481
481
/**
@@ -534,6 +534,8 @@ var DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+
534
534
* `"h 'in the morning'"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence
535
535
* (e.g. `"h 'o''clock'"`).
536
536
*
537
+ * Any other characters in the `format` string will be output as-is.
538
+ *
537
539
* @param {(Date|number|string) } date Date to format either as Date object, milliseconds (string or
538
540
* number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its
539
541
* shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is
Original file line number Diff line number Diff line change @@ -504,6 +504,10 @@ describe('filters', function() {
504
504
expect ( date ( morning , 'yy/xxx' ) ) . toEqual ( '10/xxx' ) ;
505
505
} ) ;
506
506
507
+ it ( 'should allow newlines in format' , function ( ) {
508
+ expect ( date ( midnight , 'EEE\nMMM d\'\n\'yy/xxx\n' ) ) . toEqual ( 'Fri\nSep 3\n10/xxx\n' ) ;
509
+ } ) ;
510
+
507
511
it ( 'should support various iso8061 date strings with timezone as input' , function ( ) {
508
512
var format = 'yyyy-MM-dd ss' ;
509
513
You can’t perform that action at this time.
0 commit comments