File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ var DATE_FORMATS = {
260
260
} ;
261
261
262
262
var DATE_FORMATS_SPLIT = / ( (?: [ ^ y M d H h m s a Z E ' ] + ) | (?: ' (?: [ ^ ' ] | ' ' ) * ' ) | (?: E + | y + | M + | d + | H + | h + | m + | s + | a | Z ) ) ( .* ) / ,
263
- NUMBER_STRING = / ^ \d + $ / ;
263
+ NUMBER_STRING = / ^ \- ? \ d+ $ / ;
264
264
265
265
/**
266
266
* @ngdoc filter
Original file line number Diff line number Diff line change @@ -246,6 +246,10 @@ describe('filters', function() {
246
246
toEqual ( 'September 03, 1' ) ;
247
247
} ) ;
248
248
249
+ it ( 'should accept negative numbers as strings' , function ( ) {
250
+ expect ( date ( '-1' ) ) . toEqual ( 'Dec 31, 1969' ) ;
251
+ } ) ;
252
+
249
253
it ( 'should format timezones correctly (as per ISO_8601)' , function ( ) {
250
254
//Note: TzDate's first argument is offset, _not_ timezone.
251
255
var utc = new angular . mock . TzDate ( 0 , '2010-09-03T12:05:08.000Z' ) ;
You can’t perform that action at this time.
0 commit comments