forked from fullcalendar/fullcalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefaults.js
157 lines (129 loc) · 3.16 KB
/
defaults.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
var defaults = {
lang: 'en',
defaultTimedEventDuration: '02:00:00',
defaultAllDayEventDuration: { days: 1 },
forceEventDuration: false,
nextDayThreshold: '09:00:00', // 9am
// display
defaultView: 'month',
aspectRatio: 1.35,
header: {
left: 'title',
center: '',
right: 'today prev,next'
},
weekends: true,
weekNumbers: false,
weekNumberTitle: 'W',
weekNumberCalculation: 'local',
//editable: false,
// event ajax
lazyFetching: true,
startParam: 'start',
endParam: 'end',
timezoneParam: 'timezone',
timezone: false,
//allDayDefault: undefined,
// time formats
titleFormat: {
month: 'MMMM YYYY', // like "September 1986". each language will override this
week: 'll', // like "Sep 4 1986"
day: 'LL' // like "September 4 1986"
},
columnFormat: {
month: 'ddd', // like "Sat"
week: generateWeekColumnFormat,
day: 'dddd' // like "Saturday"
},
timeFormat: { // for event elements
'default': generateShortTimeFormat
},
displayEventEnd: {
month: false,
basicWeek: false,
'default': true
},
// locale
isRTL: false,
defaultButtonText: {
prev: "prev",
next: "next",
prevYear: "prev year",
nextYear: "next year",
today: 'today',
month: 'month',
week: 'week',
day: 'day'
},
buttonIcons: {
prev: 'left-single-arrow',
next: 'right-single-arrow',
prevYear: 'left-double-arrow',
nextYear: 'right-double-arrow'
},
// jquery-ui theming
theme: false,
themeButtonIcons: {
prev: 'circle-triangle-w',
next: 'circle-triangle-e',
prevYear: 'seek-prev',
nextYear: 'seek-next'
},
dragOpacity: .75,
dragRevertDuration: 500,
dragScroll: true,
//selectable: false,
unselectAuto: true,
dropAccept: '*',
eventLimit: false,
eventLimitText: 'more',
eventLimitClick: 'popover',
dayPopoverFormat: 'LL',
handleWindowResize: true,
windowResizeDelay: 200 // milliseconds before a rerender happens
};
function generateShortTimeFormat(options, langData) {
return langData.longDateFormat('LT')
.replace(':mm', '(:mm)')
.replace(/(\Wmm)$/, '($1)') // like above, but for foreign langs
.replace(/\s*a$/i, 't'); // convert to AM/PM/am/pm to lowercase one-letter. remove any spaces beforehand
}
function generateWeekColumnFormat(options, langData) {
var format = langData.longDateFormat('L'); // for the format like "MM/DD/YYYY"
format = format.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g, ''); // strip the year off the edge, as well as other misc non-whitespace chars
if (options.isRTL) {
format += ' ddd'; // for RTL, add day-of-week to end
}
else {
format = 'ddd ' + format; // for LTR, add day-of-week to beginning
}
return format;
}
var langOptionHash = {
en: {
columnFormat: {
week: 'ddd M/D' // override for english. different from the generated default, which is MM/DD
},
dayPopoverFormat: 'dddd, MMMM D'
}
};
// right-to-left defaults
var rtlDefaults = {
header: {
left: 'next,prev today',
center: '',
right: 'title'
},
buttonIcons: {
prev: 'right-single-arrow',
next: 'left-single-arrow',
prevYear: 'right-double-arrow',
nextYear: 'left-double-arrow'
},
themeButtonIcons: {
prev: 'circle-triangle-e',
next: 'circle-triangle-w',
nextYear: 'seek-prev',
prevYear: 'seek-next'
}
};