-
Notifications
You must be signed in to change notification settings - Fork 2
/
calendar.provider.js
83 lines (62 loc) · 1.89 KB
/
calendar.provider.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
import dayTemplate from './templates/day.inner.html';
export class bcCalendarConfig {
// Define defaults
constructor() {
'ngInject';
// The calendar will begin with today
this.startDate = moment(new Date()).startOf('day').format();
// The default interval type [day|week|month]
this.nestingDepth = 'month';
// How many days should be generated
this.days = 30;
// Define the different possible representations of the weekday
this.weekdayStyle = {
letter: [
'S',
'M',
'T',
'W',
'T',
'F',
'S',
],
abbreviation: [
'Sun',
'Mon',
'Tue',
'Wed',
'Thur',
'Fri',
'Sat',
],
word: [
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
],
};
// Set the default word type (M vs Mon vs Monday)
this.dayTitleFormat = 'abbreviation';
// Should the calendar show the weekday names above each column?
this.showWeekdays = true;
// Define the default template for a day
this.dayTemplate = dayTemplate;
// Allow the user to set a custom template
this.setDayTemplate = (template) => {
this.userDayTemplate = template;
}
// Define the default format for a day
this.dateFormat = 'D';
// Define the default format for a month title
this.monthTitleFormat = 'MMMM'
// Should month titles be shown by default?
this.showMonthTitles = true;
}
$get() {
return this;
}
}