@@ -300,21 +300,23 @@ describe('filters', function() {
300
300
it ( 'should support various iso8061 date strings with timezone as input' , function ( ) {
301
301
var format = 'yyyy-MM-dd ss' ;
302
302
303
+ var localDay = new Date ( Date . UTC ( 2003 , 9 , 10 , 13 , 2 , 3 , 0 ) ) . getDate ( ) ;
304
+
303
305
//full ISO8061
304
- expect ( date ( '2003-09-10T13:02:03.000Z' , format ) ) . toEqual ( '2003-09-10 03' ) ;
306
+ expect ( date ( '2003-09-10T13:02:03.000Z' , format ) ) . toEqual ( '2003-09-' + localDay + ' 03') ;
305
307
306
- expect ( date ( '2003-09-10T13:02:03.000+00:00' , format ) ) . toEqual ( '2003-09-10 03' ) ;
308
+ expect ( date ( '2003-09-10T13:02:03.000+00:00' , format ) ) . toEqual ( '2003-09-' + localDay + ' 03') ;
307
309
308
- expect ( date ( '20030910T033203-0930' , format ) ) . toEqual ( '2003-09-10 03' ) ;
310
+ expect ( date ( '20030910T033203-0930' , format ) ) . toEqual ( '2003-09-' + localDay + ' 03') ;
309
311
310
312
//no millis
311
- expect ( date ( '2003-09-10T13:02:03Z' , format ) ) . toEqual ( '2003-09-10 03' ) ;
313
+ expect ( date ( '2003-09-10T13:02:03Z' , format ) ) . toEqual ( '2003-09-' + localDay + ' 03') ;
312
314
313
315
//no seconds
314
- expect ( date ( '2003-09-10T13:02Z' , format ) ) . toEqual ( '2003-09-10 00' ) ;
316
+ expect ( date ( '2003-09-10T13:02Z' , format ) ) . toEqual ( '2003-09-' + localDay + ' 00') ;
315
317
316
318
//no minutes
317
- expect ( date ( '2003-09-10T13Z' , format ) ) . toEqual ( '2003-09-10 00' ) ;
319
+ expect ( date ( '2003-09-10T13Z' , format ) ) . toEqual ( '2003-09-' + localDay + ' 00') ;
318
320
} ) ;
319
321
320
322
@@ -331,16 +333,18 @@ describe('filters', function() {
331
333
} ) ;
332
334
333
335
it ( 'should support different degrees of subsecond precision' , function ( ) {
334
- var format = 'yyyy-MM-dd' ;
335
-
336
- expect ( date ( '2003-09-10T13:02:03.12345678Z' , format ) ) . toEqual ( '2003-09-10' ) ;
337
- expect ( date ( '2003-09-10T13:02:03.1234567Z' , format ) ) . toEqual ( '2003-09-10' ) ;
338
- expect ( date ( '2003-09-10T13:02:03.123456Z' , format ) ) . toEqual ( '2003-09-10' ) ;
339
- expect ( date ( '2003-09-10T13:02:03.12345Z' , format ) ) . toEqual ( '2003-09-10' ) ;
340
- expect ( date ( '2003-09-10T13:02:03.1234Z' , format ) ) . toEqual ( '2003-09-10' ) ;
341
- expect ( date ( '2003-09-10T13:02:03.123Z' , format ) ) . toEqual ( '2003-09-10' ) ;
342
- expect ( date ( '2003-09-10T13:02:03.12Z' , format ) ) . toEqual ( '2003-09-10' ) ;
343
- expect ( date ( '2003-09-10T13:02:03.1Z' , format ) ) . toEqual ( '2003-09-10' ) ;
336
+ var format = 'yyyy-MM-dd ss' ;
337
+
338
+ var localDay = new Date ( Date . UTC ( 2003 , 9 - 1 , 10 , 13 , 2 , 3 , 123 ) ) . getDate ( ) ;
339
+
340
+ expect ( date ( '2003-09-10T13:02:03.12345678Z' , format ) ) . toEqual ( '2003-09-' + localDay + ' 03' ) ;
341
+ expect ( date ( '2003-09-10T13:02:03.1234567Z' , format ) ) . toEqual ( '2003-09-' + localDay + ' 03' ) ;
342
+ expect ( date ( '2003-09-10T13:02:03.123456Z' , format ) ) . toEqual ( '2003-09-' + localDay + ' 03' ) ;
343
+ expect ( date ( '2003-09-10T13:02:03.12345Z' , format ) ) . toEqual ( '2003-09-' + localDay + ' 03' ) ;
344
+ expect ( date ( '2003-09-10T13:02:03.1234Z' , format ) ) . toEqual ( '2003-09-' + localDay + ' 03' ) ;
345
+ expect ( date ( '2003-09-10T13:02:03.123Z' , format ) ) . toEqual ( '2003-09-' + localDay + ' 03' ) ;
346
+ expect ( date ( '2003-09-10T13:02:03.12Z' , format ) ) . toEqual ( '2003-09-' + localDay + ' 03' ) ;
347
+ expect ( date ( '2003-09-10T13:02:03.1Z' , format ) ) . toEqual ( '2003-09-' + localDay + ' 03' ) ;
344
348
} ) ;
345
349
} ) ;
346
350
} ) ;
0 commit comments