@@ -4,27 +4,100 @@ import moment from 'moment'
4
4
5
5
import { Calendar , DragableCalendar } from './helpers'
6
6
7
- storiesOf ( 'Event Durations' ) . add ( 'Daylight savings' , ( ) => {
8
- return (
9
- < DragableCalendar
10
- defaultView = { Calendar . Views . DAY }
11
- min = { moment ( '12:00am' , 'h:mma' ) . toDate ( ) }
12
- max = { moment ( '11:59pm' , 'h:mma' ) . toDate ( ) }
13
- events = { [
14
- {
15
- title : 'on DST' ,
16
- start : new Date ( 2017 , 2 , 12 , 1 ) ,
17
- end : new Date ( 2017 , 2 , 12 , 2 , 30 ) ,
18
- allDay : false ,
19
- } ,
20
- {
21
- title : 'crosses DST' ,
22
- start : new Date ( 2017 , 2 , 12 , 1 ) ,
23
- end : new Date ( 2017 , 2 , 12 , 6 , 30 ) ,
24
- allDay : false ,
25
- } ,
26
- ] }
27
- defaultDate = { new Date ( 2017 , 2 , 12 ) }
28
- />
29
- )
30
- } )
7
+ storiesOf ( 'Event Durations' )
8
+ . add ( 'Daylight savings starts' , ( ) => {
9
+ return (
10
+ < DragableCalendar
11
+ defaultView = { Calendar . Views . DAY }
12
+ min = { moment ( '12:00am' , 'h:mma' ) . toDate ( ) }
13
+ max = { moment ( '11:59pm' , 'h:mma' ) . toDate ( ) }
14
+ events = { [
15
+ {
16
+ title : 'on DST' ,
17
+ start : new Date ( 2017 , 2 , 12 , 1 ) ,
18
+ end : new Date ( 2017 , 2 , 12 , 2 , 30 ) ,
19
+ allDay : false ,
20
+ } ,
21
+ {
22
+ title : 'crosses DST' ,
23
+ start : new Date ( 2017 , 2 , 12 , 1 ) ,
24
+ end : new Date ( 2017 , 2 , 12 , 6 , 30 ) ,
25
+ allDay : false ,
26
+ } ,
27
+ {
28
+ title : 'After DST' ,
29
+ start : new Date ( 2017 , 2 , 12 , 7 ) ,
30
+ end : new Date ( 2017 , 2 , 12 , 9 , 30 ) ,
31
+ allDay : false ,
32
+ } ,
33
+ ] }
34
+ defaultDate = { new Date ( 2017 , 2 , 12 ) }
35
+ />
36
+ )
37
+ } )
38
+ . add ( 'Daylight savings ends' , ( ) => {
39
+ return (
40
+ < DragableCalendar
41
+ defaultView = { Calendar . Views . DAY }
42
+ min = { moment ( '12:00am' , 'h:mma' ) . toDate ( ) }
43
+ max = { moment ( '11:59pm' , 'h:mma' ) . toDate ( ) }
44
+ events = { [
45
+ {
46
+ title : 'on DST' ,
47
+ start : new Date ( 2017 , 10 , 5 , 1 ) ,
48
+ end : new Date ( 2017 , 10 , 5 , 3 , 30 ) ,
49
+ allDay : false ,
50
+ } ,
51
+ {
52
+ title : 'crosses DST' ,
53
+ start : new Date ( 2017 , 10 , 5 , 1 ) ,
54
+ end : new Date ( 2017 , 10 , 5 , 6 , 30 ) ,
55
+ allDay : false ,
56
+ } ,
57
+ {
58
+ title : 'After DST' ,
59
+ start : new Date ( 2017 , 10 , 5 , 7 ) ,
60
+ end : new Date ( 2017 , 10 , 5 , 7 , 45 ) ,
61
+ allDay : false ,
62
+ } ,
63
+ ] }
64
+ defaultDate = { new Date ( 2017 , 10 , 5 ) }
65
+ />
66
+ )
67
+ } )
68
+ . add ( 'Daylight savings starts, after 2am' , ( ) => {
69
+ return (
70
+ < DragableCalendar
71
+ defaultView = { Calendar . Views . DAY }
72
+ min = { moment ( '3:00am' , 'h:mma' ) . toDate ( ) }
73
+ max = { moment ( '11:59pm' , 'h:mma' ) . toDate ( ) }
74
+ events = { [
75
+ {
76
+ title : 'After DST' ,
77
+ start : new Date ( 2017 , 2 , 12 , 7 ) ,
78
+ end : new Date ( 2017 , 2 , 12 , 9 , 30 ) ,
79
+ allDay : false ,
80
+ } ,
81
+ ] }
82
+ defaultDate = { new Date ( 2017 , 2 , 12 ) }
83
+ />
84
+ )
85
+ } )
86
+ . add ( 'Daylight savings ends, after 2am' , ( ) => {
87
+ return (
88
+ < DragableCalendar
89
+ defaultView = { Calendar . Views . DAY }
90
+ min = { moment ( '3:00am' , 'h:mma' ) . toDate ( ) }
91
+ max = { moment ( '11:59pm' , 'h:mma' ) . toDate ( ) }
92
+ events = { [
93
+ {
94
+ title : 'After DST' ,
95
+ start : new Date ( 2017 , 10 , 5 , 7 ) ,
96
+ end : new Date ( 2017 , 10 , 5 , 9 , 30 ) ,
97
+ allDay : false ,
98
+ } ,
99
+ ] }
100
+ defaultDate = { new Date ( 2017 , 10 , 5 ) }
101
+ />
102
+ )
103
+ } )
0 commit comments