mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
refactor: 💡 Add typing
This commit is contained in:
parent
f650cca652
commit
48ad381a50
@ -266,7 +266,7 @@ function getMonthNote(dateStr: string, _rootNote: BNote | null = null): BNote {
|
|||||||
return monthNote;
|
return monthNote;
|
||||||
}
|
}
|
||||||
|
|
||||||
let monthParentNote;
|
let monthParentNote: BNote | null;
|
||||||
|
|
||||||
if (rootNote.hasLabel("enableQuarterNote")) {
|
if (rootNote.hasLabel("enableQuarterNote")) {
|
||||||
monthParentNote = getQuarterNote(getQuarterNumberStr(dayjs(dateStr)), rootNote);
|
monthParentNote = getQuarterNote(getQuarterNumberStr(dayjs(dateStr)), rootNote);
|
||||||
@ -296,7 +296,7 @@ function getMonthNote(dateStr: string, _rootNote: BNote | null = null): BNote {
|
|||||||
|
|
||||||
function getWeekStartDate(date: Dayjs): Dayjs {
|
function getWeekStartDate(date: Dayjs): Dayjs {
|
||||||
const day = date.day();
|
const day = date.day();
|
||||||
let diff;
|
let diff: number;
|
||||||
|
|
||||||
if (optionService.getOption("firstDayOfWeek") === "0") { // Sunday
|
if (optionService.getOption("firstDayOfWeek") === "0") { // Sunday
|
||||||
diff = date.date() - day + (day === 0 ? -6 : 1); // adjust when day is sunday
|
diff = date.date() - day + (day === 0 ? -6 : 1); // adjust when day is sunday
|
||||||
@ -456,7 +456,7 @@ function getDayNote(dateStr: string, _rootNote: BNote | null = null): BNote {
|
|||||||
return dateNote;
|
return dateNote;
|
||||||
}
|
}
|
||||||
|
|
||||||
let dateParentNote;
|
let dateParentNote: BNote | null;
|
||||||
|
|
||||||
if (rootNote.hasLabel("enableWeekNote")) {
|
if (rootNote.hasLabel("enableWeekNote")) {
|
||||||
dateParentNote = getWeekNote(getWeekNumberStr(dayjs(dateStr)), rootNote);
|
dateParentNote = getWeekNote(getWeekNumberStr(dayjs(dateStr)), rootNote);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user