mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
client: Add support for first day of week (closes #247)
This commit is contained in:
parent
981ff34ac4
commit
5c326c553c
@ -167,11 +167,14 @@ export default class CalendarWidget extends RightDropdownButtonWidget {
|
||||
|
||||
// if it's the first day of the month
|
||||
if (num === 1) {
|
||||
if (day === 0) {
|
||||
$newDay.css("marginLeft", (6 * 14.28) + '%');
|
||||
} else {
|
||||
$newDay.css("marginLeft", `${(day - 1) * 14.28}%`);
|
||||
}
|
||||
// 0 1 2 3 4 5 6
|
||||
// Su Mo Tu We Th Fr Sa
|
||||
// 1 2 3 4 5 6 0
|
||||
// Mo Tu We Th Fr Sa Su
|
||||
let dayOffset = day - this.firstDayOfWeek;
|
||||
if (dayOffset < 0)
|
||||
dayOffset = 7 + dayOffset;
|
||||
$newDay.css("marginLeft", (dayOffset * 14.28) + '%');
|
||||
}
|
||||
|
||||
const dateNoteId = dateNotesForMonth[utils.formatDateISO(this.date)];
|
||||
|
Loading…
x
Reference in New Issue
Block a user