-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathCALEXT2_ViewDaily.js
More file actions
27 lines (25 loc) · 1.02 KB
/
CALEXT2_ViewDaily.js
File metadata and controls
27 lines (25 loc) · 1.02 KB
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
/* global SlotDateHelpers ViewPeriod */
// eslint-disable-next-line no-unused-vars
class ViewDaily extends ViewPeriod {
constructor (config, events) {
super(config, events);
this.slotUnit = "day";
}
makeSlotDomClass (slot) {
const slotDom = slot.dom;
super.makeSlotDomClass(slot);
slotDom.classList.add("daily");
const info = SlotDateHelpers.getSlotDateInfo(slot.start.toDate(), null, null, this.config.weekStart);
if (info.isSameYear) slotDom.classList.add("thisyear");
if (info.isSameMonth) slotDom.classList.add("thismonth");
if (info.isSameWeek) slotDom.classList.add("thisweek");
if (info.isToday) slotDom.classList.add("today");
if (info.isPassed) slotDom.classList.add("passed");
slotDom.classList.add(`weekday_${info.weekday}`);
slotDom.classList.add(`year_${info.year}`);
slotDom.classList.add(`month_${info.month}`);
slotDom.classList.add(`day_${info.day}`);
slotDom.classList.add(`week_${info.week}`);
slotDom.classList.add(`dayofyear_${info.dayOfYear}`);
}
}