refactor: 💡 fix lint

This commit is contained in:
Jin 2025-04-04 13:55:13 +02:00
parent 6a0207dc45
commit f9c0b88539

View File

@ -1,20 +1,21 @@
import noteService from "./notes.js";
import attributeService from "./attributes.js";
import sql from "./sql.js";
import protectedSessionService from "./protected_session.js";
import searchService from "../services/search/services/search.js";
import SearchContext from "../services/search/search_context.js";
import hoistedNoteService from "./hoisted_note.js";
import type BNote from "../becca/entities/bnote.js"; import type BNote from "../becca/entities/bnote.js";
import optionService from "./options.js";
import { t } from "i18next";
import i18next from "i18next";
import dayjs from "dayjs";
import type { Dayjs } from "dayjs"; import type { Dayjs } from "dayjs";
import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js";
import quarterOfYear from "dayjs/plugin/quarterOfYear.js";
import advancedFormat from "dayjs/plugin/advancedFormat.js"; import advancedFormat from "dayjs/plugin/advancedFormat.js";
import attributeService from "./attributes.js";
import cloningService from "./cloning.js"; import cloningService from "./cloning.js";
import dayjs from "dayjs";
import hoistedNoteService from "./hoisted_note.js";
import i18next from "i18next";
import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js";
import noteService from "./notes.js";
import optionService from "./options.js";
import protectedSessionService from "./protected_session.js";
import quarterOfYear from "dayjs/plugin/quarterOfYear.js";
import searchContext from "../services/search/search_context.js";
import searchService from "../services/search/services/search.js";
import sql from "./sql.js";
import { t } from "i18next";
dayjs.extend(isSameOrAfter); dayjs.extend(isSameOrAfter);
dayjs.extend(quarterOfYear); dayjs.extend(quarterOfYear);
@ -27,7 +28,7 @@ const MONTH_LABEL = "monthNote";
const WEEK_LABEL = "weekNote"; const WEEK_LABEL = "weekNote";
const DATE_LABEL = "dateNote"; const DATE_LABEL = "dateNote";
const WEEKDAY_TRANSLATION_IDS = ["weekdays.sunday", "weekdays.monday", "weekdays.tuesday", "weekdays.wednesday", "weekdays.thursday", "weekdays.friday", "weekdays.saturday", "weekdays.sunday"]; const WEEKDAY_TRANSLATION_IDS = [ "weekdays.sunday", "weekdays.monday", "weekdays.tuesday", "weekdays.wednesday", "weekdays.thursday", "weekdays.friday", "weekdays.saturday", "weekdays.sunday" ];
const MONTH_TRANSLATION_IDS = [ const MONTH_TRANSLATION_IDS = [
"months.january", "months.january",
@ -44,26 +45,26 @@ const MONTH_TRANSLATION_IDS = [
"months.december" "months.december"
]; ];
type TimeUnit = 'year' | 'quarter' | 'month' | 'week' | 'day'; type TimeUnit = "year" | "quarter" | "month" | "week" | "day";
const baseReplacements = { const baseReplacements = {
year: ['year'], year: [ "year" ],
quarter: ['quarterNumber', 'shortQuarter'], quarter: [ "quarterNumber", "shortQuarter" ],
month: ['isoMonth', 'monthNumber', 'monthNumberPadded', 'month', 'shortMonth3', 'shortMonth4'], month: [ "isoMonth", "monthNumber", "monthNumberPadded", "month", "shortMonth3", "shortMonth4" ],
week: ['weekNumber', 'weekNumberPadded', 'shortWeek', 'shortWeek3'], week: [ "weekNumber", "weekNumberPadded", "shortWeek", "shortWeek3" ],
day: ['isoDate', 'dateNumber', 'dateNumberPadded', 'ordinal', 'weekDay', 'weekDay3', 'weekDay2'] day: [ "isoDate", "dateNumber", "dateNumberPadded", "ordinal", "weekDay", "weekDay3", "weekDay2" ]
}; };
function getTimeUnitReplacements(timeUnit: TimeUnit): string[] { function getTimeUnitReplacements(timeUnit: TimeUnit): string[] {
const units: TimeUnit[] = ['year', 'quarter', 'month', 'week', 'day']; const units: TimeUnit[] = [ "year", "quarter", "month", "week", "day" ];
const index = units.indexOf(timeUnit); const index = units.indexOf(timeUnit);
return units.slice(0, index + 1).flatMap(unit => baseReplacements[unit]); return units.slice(0, index + 1).flatMap(unit => baseReplacements[unit]);
} }
async function ordinal(date: Dayjs, lng: string) { async function ordinal(date: Dayjs, lng: string) {
const localeMap: Record<string, string> = { const localeMap: Record<string, string> = {
'cn': 'zh-cn', cn: "zh-cn",
'tw': 'zh-tw' tw: "zh-tw"
}; };
const dayjsLocale = localeMap[lng] || lng; const dayjsLocale = localeMap[lng] || lng;
@ -74,15 +75,15 @@ async function ordinal(date: Dayjs, lng: string) {
console.warn(`Could not load locale ${dayjsLocale}`, err); console.warn(`Could not load locale ${dayjsLocale}`, err);
} }
return dayjs(date).locale(dayjsLocale).format('Do'); return dayjs(date).locale(dayjsLocale).format("Do");
} }
async function getJournalNoteTitle(rootNote: BNote, timeUnit: TimeUnit, dateObj: Dayjs, number: number) { async function getJournalNoteTitle(rootNote: BNote, timeUnit: TimeUnit, dateObj: Dayjs, number: number) {
const patterns = { const patterns = {
year: rootNote.getOwnedLabelValue("yearPattern") || "{year}", year: rootNote.getOwnedLabelValue("yearPattern") || "{year}",
quarter: rootNote.getOwnedLabelValue("quarterPattern") || t('quarterNumber'), quarter: rootNote.getOwnedLabelValue("quarterPattern") || t("quarterNumber"),
month: rootNote.getOwnedLabelValue("monthPattern") || "{monthNumberPadded} - {month}", month: rootNote.getOwnedLabelValue("monthPattern") || "{monthNumberPadded} - {month}",
week: rootNote.getOwnedLabelValue("weekPattern") || t('weekdayNumber'), week: rootNote.getOwnedLabelValue("weekPattern") || t("weekdayNumber"),
day: rootNote.getOwnedLabelValue("datePattern") || "{dateNumberPadded} - {weekDay}" day: rootNote.getOwnedLabelValue("datePattern") || "{dateNumberPadded} - {weekDay}"
}; };
@ -94,37 +95,37 @@ async function getJournalNoteTitle(rootNote: BNote, timeUnit: TimeUnit, dateObj:
const allReplacements: Record<string, string> = { const allReplacements: Record<string, string> = {
// Common date formats // Common date formats
'{year}': dateObj.format('YYYY'), "{year}": dateObj.format("YYYY"),
// Month related // Month related
'{isoMonth}': dateObj.format('YYYY-MM'), "{isoMonth}": dateObj.format("YYYY-MM"),
'{monthNumber}': numberStr, "{monthNumber}": numberStr,
'{monthNumberPadded}': numberStr.padStart(2, '0'), "{monthNumberPadded}": numberStr.padStart(2, "0"),
'{month}': monthName, "{month}": monthName,
'{shortMonth3}': monthName.slice(0, 3), "{shortMonth3}": monthName.slice(0, 3),
'{shortMonth4}': monthName.slice(0, 4), "{shortMonth4}": monthName.slice(0, 4),
// Quarter related // Quarter related
'{quarterNumber}': numberStr, "{quarterNumber}": numberStr,
'{shortQuarter}': `Q${numberStr}`, "{shortQuarter}": `Q${numberStr}`,
// Week related // Week related
'{weekNumber}': numberStr, "{weekNumber}": numberStr,
'{weekNumberPadded}': numberStr.padStart(2, '0'), "{weekNumberPadded}": numberStr.padStart(2, "0"),
'{shortWeek}': `W${numberStr}`, "{shortWeek}": `W${numberStr}`,
'{shortWeek3}': `W${numberStr.padStart(2, '0')}`, "{shortWeek3}": `W${numberStr.padStart(2, "0")}`,
// Day related // Day related
'{isoDate}': dateObj.format('YYYY-MM-DD'), "{isoDate}": dateObj.format("YYYY-MM-DD"),
'{dateNumber}': numberStr, "{dateNumber}": numberStr,
'{dateNumberPadded}': numberStr.padStart(2, '0'), "{dateNumberPadded}": numberStr.padStart(2, "0"),
'{ordinal}': ordinalStr, "{ordinal}": ordinalStr,
'{weekDay}': weekDay, "{weekDay}": weekDay,
'{weekDay3}': weekDay.substring(0, 3), "{weekDay3}": weekDay.substring(0, 3),
'{weekDay2}': weekDay.substring(0, 2) "{weekDay2}": weekDay.substring(0, 2)
}; };
const allowedReplacements = Object.entries(allReplacements).reduce((acc, [key, value]) => { const allowedReplacements = Object.entries(allReplacements).reduce((acc, [ key, value ]) => {
const replacementKey = key.slice(1, -1); const replacementKey = key.slice(1, -1);
if (getTimeUnitReplacements(timeUnit).includes(replacementKey)) { if (getTimeUnitReplacements(timeUnit).includes(replacementKey)) {
acc[key] = value; acc[key] = value;
@ -133,7 +134,7 @@ async function getJournalNoteTitle(rootNote: BNote, timeUnit: TimeUnit, dateObj:
}, {} as Record<string, string>); }, {} as Record<string, string>);
return Object.entries(allowedReplacements).reduce( return Object.entries(allowedReplacements).reduce(
(title, [key, value]) => title.replace(new RegExp(key, 'g'), value), (title, [ key, value ]) => title.replace(new RegExp(key, "g"), value),
pattern pattern
); );
} }
@ -154,7 +155,7 @@ function getRootCalendarNote(): BNote {
const workspaceNote = hoistedNoteService.getWorkspaceNote(); const workspaceNote = hoistedNoteService.getWorkspaceNote();
if (!workspaceNote || !workspaceNote.isRoot()) { if (!workspaceNote || !workspaceNote.isRoot()) {
rootNote = searchService.findFirstNoteWithQuery("#workspaceCalendarRoot", new SearchContext({ ignoreHoistedNote: false })); rootNote = searchService.findFirstNoteWithQuery("#workspaceCalendarRoot", new searchContext({ ignoreHoistedNote: false }));
} }
if (!rootNote) { if (!rootNote) {
@ -185,7 +186,7 @@ function getYearNote(dateStr: string, _rootNote: BNote | null = null): BNote {
const yearStr = dateStr.trim().substring(0, 4); const yearStr = dateStr.trim().substring(0, 4);
let yearNote = searchService.findFirstNoteWithQuery(`#${YEAR_LABEL}="${yearStr}"`, new SearchContext({ ancestorNoteId: rootNote.noteId })); let yearNote = searchService.findFirstNoteWithQuery(`#${YEAR_LABEL}="${yearStr}"`, new searchContext({ ancestorNoteId: rootNote.noteId }));
if (yearNote) { if (yearNote) {
return yearNote; return yearNote;
@ -216,19 +217,19 @@ async function getQuarterNote(quarterStr: string, _rootNote: BNote | null = null
quarterStr = quarterStr.trim().substring(0, 7); quarterStr = quarterStr.trim().substring(0, 7);
let quarterNote = searchService.findFirstNoteWithQuery(`#${QUARTER_LABEL}="${quarterStr}"`, new SearchContext({ ancestorNoteId: rootNote.noteId })); let quarterNote = searchService.findFirstNoteWithQuery(`#${QUARTER_LABEL}="${quarterStr}"`, new searchContext({ ancestorNoteId: rootNote.noteId }));
if (quarterNote) { if (quarterNote) {
return quarterNote; return quarterNote;
} }
const [yearStr, quarterNumberStr] = quarterStr.trim().split('-Q'); const [ yearStr, quarterNumberStr ] = quarterStr.trim().split("-Q");
const quarterNumber = parseInt(quarterNumberStr); const quarterNumber = parseInt(quarterNumberStr);
const firstMonth = (quarterNumber - 1) * 3; const firstMonth = (quarterNumber - 1) * 3;
const quarterStartDate = dayjs().year(parseInt(yearStr)).month(firstMonth).date(1); const quarterStartDate = dayjs().year(parseInt(yearStr)).month(firstMonth).date(1);
const yearNote = getYearNote(yearStr, rootNote); const yearNote = getYearNote(yearStr, rootNote);
const noteTitle = await getJournalNoteTitle(rootNote, 'quarter', quarterStartDate, quarterNumber); const noteTitle = await getJournalNoteTitle(rootNote, "quarter", quarterStartDate, quarterNumber);
sql.transactional(() => { sql.transactional(() => {
quarterNote = createNote(yearNote, noteTitle); quarterNote = createNote(yearNote, noteTitle);
@ -252,7 +253,7 @@ async function getMonthNote(dateStr: string, _rootNote: BNote | null = null): Pr
const monthStr = dateStr.substring(0, 7); const monthStr = dateStr.substring(0, 7);
const monthNumber = dateStr.substring(5, 7); const monthNumber = dateStr.substring(5, 7);
let monthNote = searchService.findFirstNoteWithQuery(`#${MONTH_LABEL}="${monthStr}"`, new SearchContext({ ancestorNoteId: rootNote.noteId })); let monthNote = searchService.findFirstNoteWithQuery(`#${MONTH_LABEL}="${monthStr}"`, new searchContext({ ancestorNoteId: rootNote.noteId }));
if (monthNote) { if (monthNote) {
return monthNote; return monthNote;
@ -260,13 +261,13 @@ async function getMonthNote(dateStr: string, _rootNote: BNote | null = null): Pr
let monthParentNote; let monthParentNote;
if (rootNote.hasLabel('enableQuarterNote')) { if (rootNote.hasLabel("enableQuarterNote")) {
monthParentNote = await getQuarterNote(getQuarterNumberStr(dayjs(dateStr)), rootNote); monthParentNote = await getQuarterNote(getQuarterNumberStr(dayjs(dateStr)), rootNote);
} else { } else {
monthParentNote = getYearNote(dateStr, rootNote); monthParentNote = getYearNote(dateStr, rootNote);
} }
const noteTitle = await getJournalNoteTitle(rootNote, 'month', dayjs(dateStr), parseInt(monthNumber)); const noteTitle = await getJournalNoteTitle(rootNote, "month", dayjs(dateStr), parseInt(monthNumber));
sql.transactional(() => { sql.transactional(() => {
monthNote = createNote(monthParentNote, noteTitle); monthNote = createNote(monthParentNote, noteTitle);
@ -308,33 +309,33 @@ function getWeekNumberStr(date: Dayjs): string {
const jan1 = date.clone().year(year).month(0).date(1); const jan1 = date.clone().year(year).month(0).date(1);
const jan1Weekday = jan1.day(); const jan1Weekday = jan1.day();
const dayOffset = dayOfWeek(jan1Weekday); const dayOffset = dayOfWeek(jan1Weekday);
let firstWeekStart = jan1.clone().subtract(dayOffset, 'day'); let firstWeekStart = jan1.clone().subtract(dayOffset, "day");
// Adjust based on week rule // Adjust based on week rule
switch (parseInt(optionService.getOption("firstWeekOfYear"))) { switch (parseInt(optionService.getOption("firstWeekOfYear"))) {
case 1: { // ISO 8601: first week contains Thursday case 1: { // ISO 8601: first week contains Thursday
const thursday = firstWeekStart.clone().add(3, 'day'); // Monday + 3 = Thursday const thursday = firstWeekStart.clone().add(3, "day"); // Monday + 3 = Thursday
if (thursday.year() < year) { if (thursday.year() < year) {
firstWeekStart = firstWeekStart.add(7, 'day'); firstWeekStart = firstWeekStart.add(7, "day");
} }
break; break;
} }
case 2: { // minDaysInFirstWeek rule case 2: { // minDaysInFirstWeek rule
const daysInFirstWeek = 7 - dayOffset; const daysInFirstWeek = 7 - dayOffset;
if (daysInFirstWeek < parseInt(optionService.getOption("minDaysInFirstWeek"))) { if (daysInFirstWeek < parseInt(optionService.getOption("minDaysInFirstWeek"))) {
firstWeekStart = firstWeekStart.add(7, 'day'); firstWeekStart = firstWeekStart.add(7, "day");
} }
break; break;
} }
// default case 0: week containing Jan 1 → already handled // default case 0: week containing Jan 1 → already handled
} }
const diffDays = date.startOf('day').diff(firstWeekStart.startOf('day'), 'day'); const diffDays = date.startOf("day").diff(firstWeekStart.startOf("day"), "day");
const weekNumber = Math.floor(diffDays / 7) + 1; const weekNumber = Math.floor(diffDays / 7) + 1;
// Handle case when date is before first week start → belongs to last week of previous year // Handle case when date is before first week start → belongs to last week of previous year
if (weekNumber <= 0) { if (weekNumber <= 0) {
return getWeekNumberStr(date.subtract(1, 'day')); return getWeekNumberStr(date.subtract(1, "day"));
} }
// Handle case when date belongs to first week of next year // Handle case when date belongs to first week of next year
@ -342,20 +343,20 @@ function getWeekNumberStr(date: Dayjs): string {
const jan1Next = date.clone().year(nextYear).month(0).date(1); const jan1Next = date.clone().year(nextYear).month(0).date(1);
const jan1WeekdayNext = jan1Next.day(); const jan1WeekdayNext = jan1Next.day();
const offsetNext = dayOfWeek(jan1WeekdayNext); const offsetNext = dayOfWeek(jan1WeekdayNext);
let nextYearWeekStart = jan1Next.clone().subtract(offsetNext, 'day'); let nextYearWeekStart = jan1Next.clone().subtract(offsetNext, "day");
switch (parseInt(optionService.getOption("firstWeekOfYear"))) { switch (parseInt(optionService.getOption("firstWeekOfYear"))) {
case 1: { case 1: {
const thursday = nextYearWeekStart.clone().add(3, 'day'); const thursday = nextYearWeekStart.clone().add(3, "day");
if (thursday.year() < nextYear) { if (thursday.year() < nextYear) {
nextYearWeekStart = nextYearWeekStart.add(7, 'day'); nextYearWeekStart = nextYearWeekStart.add(7, "day");
} }
break; break;
} }
case 2: { case 2: {
const daysInFirstWeek = 7 - offsetNext; const daysInFirstWeek = 7 - offsetNext;
if (daysInFirstWeek < parseInt(optionService.getOption("minDaysInFirstWeek"))) { if (daysInFirstWeek < parseInt(optionService.getOption("minDaysInFirstWeek"))) {
nextYearWeekStart = nextYearWeekStart.add(7, 'day'); nextYearWeekStart = nextYearWeekStart.add(7, "day");
} }
break; break;
} }
@ -365,41 +366,41 @@ function getWeekNumberStr(date: Dayjs): string {
return `${nextYear}-W01`; return `${nextYear}-W01`;
} }
return `${year}-W${weekNumber.toString().padStart(2, '0')}`; return `${year}-W${weekNumber.toString().padStart(2, "0")}`;
} }
function getWeekFirstDayNote(dateStr: string, rootNote: BNote | null = null) { function getWeekFirstDayNote(dateStr: string, rootNote: BNote | null = null) {
const weekStartDate = getWeekStartDate(dayjs(dateStr)); const weekStartDate = getWeekStartDate(dayjs(dateStr));
return getDayNote(weekStartDate.format('YYYY-MM-DD'), rootNote); return getDayNote(weekStartDate.format("YYYY-MM-DD"), rootNote);
} }
async function getWeekNote(weekStr: string, _rootNote: BNote | null = null): Promise<BNote | null> { async function getWeekNote(weekStr: string, _rootNote: BNote | null = null): Promise<BNote | null> {
const rootNote = _rootNote || getRootCalendarNote(); const rootNote = _rootNote || getRootCalendarNote();
if (!rootNote.hasLabel('enableWeekNote')) { if (!rootNote.hasLabel("enableWeekNote")) {
return null; return null;
} }
weekStr = weekStr.trim().substring(0, 8); weekStr = weekStr.trim().substring(0, 8);
let weekNote = searchService.findFirstNoteWithQuery(`#${WEEK_LABEL}="${weekStr}"`, new SearchContext({ ancestorNoteId: rootNote.noteId })); let weekNote = searchService.findFirstNoteWithQuery(`#${WEEK_LABEL}="${weekStr}"`, new searchContext({ ancestorNoteId: rootNote.noteId }));
if (weekNote) { if (weekNote) {
return weekNote; return weekNote;
} }
const [yearStr, weekNumStr] = weekStr.trim().split('-W'); const [ yearStr, weekNumStr ] = weekStr.trim().split("-W");
const weekNumber = parseInt(weekNumStr); const weekNumber = parseInt(weekNumStr);
const firstDayOfYear = dayjs().year(parseInt(yearStr)).month(0).date(1); const firstDayOfYear = dayjs().year(parseInt(yearStr)).month(0).date(1);
const weekStartDate = firstDayOfYear.add(weekNumber - 1, 'week'); const weekStartDate = firstDayOfYear.add(weekNumber - 1, "week");
const startDate = getWeekStartDate(weekStartDate); const startDate = getWeekStartDate(weekStartDate);
const endDate = dayjs(startDate).add(6, 'day'); const endDate = dayjs(startDate).add(6, "day");
const startMonth = startDate.month(); const startMonth = startDate.month();
const endMonth = endDate.month(); const endMonth = endDate.month();
const monthNote = await getMonthNote(startDate.format('YYYY-MM-DD'), rootNote); const monthNote = await getMonthNote(startDate.format("YYYY-MM-DD"), rootNote);
const noteTitle = await getJournalNoteTitle(rootNote, 'week', startDate, weekNumber); const noteTitle = await getJournalNoteTitle(rootNote, "week", startDate, weekNumber);
sql.transactional(async () => { sql.transactional(async () => {
weekNote = createNote(monthNote, noteTitle); weekNote = createNote(monthNote, noteTitle);
@ -415,7 +416,7 @@ async function getWeekNote(weekStr: string, _rootNote: BNote | null = null): Pro
// If the week spans different months, clone the week note in the other month as well // If the week spans different months, clone the week note in the other month as well
if (startMonth !== endMonth) { if (startMonth !== endMonth) {
const secondMonthNote = await getMonthNote(endDate.format('YYYY-MM-DD'), rootNote); const secondMonthNote = await getMonthNote(endDate.format("YYYY-MM-DD"), rootNote);
cloningService.cloneNoteToParentNote(weekNote.noteId, secondMonthNote.noteId); cloningService.cloneNoteToParentNote(weekNote.noteId, secondMonthNote.noteId);
} }
}); });
@ -428,7 +429,7 @@ async function getDayNote(dateStr: string, _rootNote: BNote | null = null): Prom
dateStr = dateStr.trim().substring(0, 10); dateStr = dateStr.trim().substring(0, 10);
let dateNote = searchService.findFirstNoteWithQuery(`#${DATE_LABEL}="${dateStr}"`, new SearchContext({ ancestorNoteId: rootNote.noteId })); let dateNote = searchService.findFirstNoteWithQuery(`#${DATE_LABEL}="${dateStr}"`, new searchContext({ ancestorNoteId: rootNote.noteId }));
if (dateNote) { if (dateNote) {
return dateNote; return dateNote;
@ -436,14 +437,14 @@ async function getDayNote(dateStr: string, _rootNote: BNote | null = null): Prom
let dateParentNote; let dateParentNote;
if (rootNote.hasLabel('enableWeekNote')) { if (rootNote.hasLabel("enableWeekNote")) {
dateParentNote = await getWeekNote(getWeekNumberStr(dayjs(dateStr)), rootNote); dateParentNote = await getWeekNote(getWeekNumberStr(dayjs(dateStr)), rootNote);
} else { } else {
dateParentNote = await getMonthNote(dateStr, rootNote); dateParentNote = await getMonthNote(dateStr, rootNote);
} }
const dayNumber = dateStr.substring(8, 10); const dayNumber = dateStr.substring(8, 10);
const noteTitle = await getJournalNoteTitle(rootNote, 'day', dayjs(dateStr), parseInt(dayNumber)); const noteTitle = await getJournalNoteTitle(rootNote, "day", dayjs(dateStr), parseInt(dayNumber));
sql.transactional(() => { sql.transactional(() => {
dateNote = createNote(dateParentNote as BNote, noteTitle); dateNote = createNote(dateParentNote as BNote, noteTitle);
@ -461,7 +462,7 @@ async function getDayNote(dateStr: string, _rootNote: BNote | null = null): Prom
} }
function getTodayNote(rootNote: BNote | null = null) { function getTodayNote(rootNote: BNote | null = null) {
return getDayNote(dayjs().format('YYYY-MM-DD'), rootNote); return getDayNote(dayjs().format("YYYY-MM-DD"), rootNote);
} }
export default { export default {