File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -52,3 +52,13 @@ it('Add Time days', () => {
52
52
it ( 'Subtract Time days' , ( ) => {
53
53
expect ( dayjs ( ) . subtract ( 1 , 'days' ) . valueOf ( ) ) . toBe ( moment ( ) . subtract ( 1 , 'days' ) . valueOf ( ) )
54
54
} )
55
+
56
+ it ( 'Add Time days (DST)' , ( ) => {
57
+ // change timezone before running test
58
+ // New Zealand (-720)
59
+ expect ( dayjs ( '2018-04-01' ) . add ( 1 , 'd' ) . format ( ) ) . toBe ( moment ( '2018-04-01' ) . add ( 1 , 'd' ) . format ( ) )
60
+ expect ( dayjs ( '2018-03-28' ) . add ( 1 , 'w' ) . format ( ) ) . toBe ( moment ( '2018-03-28' ) . add ( 1 , 'w' ) . format ( ) )
61
+ // London (-60)
62
+ expect ( dayjs ( '2018-10-28' ) . add ( 1 , 'd' ) . format ( ) ) . toBe ( moment ( '2018-10-28' ) . add ( 1 , 'd' ) . format ( ) )
63
+ expect ( dayjs ( '2018-10-26' ) . add ( 1 , 'w' ) . format ( ) ) . toBe ( moment ( '2018-10-26' ) . add ( 1 , 'w' ) . format ( ) )
64
+ } )
You can’t perform that action at this time.
0 commit comments