mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 06:24:30 +01:00
Use NoteLabel instead of CustomisableLabel
This commit is contained in:
parent
d0de9e5e21
commit
ecf9ce586c
@ -6,7 +6,7 @@ import "./index.css";
|
||||
import { useNoteLabel, useNoteLabelBoolean, useResizeObserver, useSpacedUpdate, useTriliumEvent, useTriliumOption, useTriliumOptionInt } from "../../react/hooks";
|
||||
import { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons";
|
||||
import { Calendar as FullCalendar } from "@fullcalendar/core";
|
||||
import { parseStartEndDateFromEvent, parseStartEndTimeFromEvent, getCustomisableLabel } from "./utils";
|
||||
import { parseStartEndDateFromEvent, parseStartEndTimeFromEvent } from "./utils";
|
||||
import dialog from "../../../services/dialog";
|
||||
import { t } from "../../../services/i18n";
|
||||
import { buildEvents, buildEventsForCalendar } from "./event_builder";
|
||||
@ -91,7 +91,7 @@ export default function CalendarView({ note, noteIds }: ViewModeProps<CalendarVi
|
||||
const [ hideWeekends ] = useNoteLabelBoolean(note, "calendar:hideWeekends");
|
||||
const [ weekNumbers ] = useNoteLabelBoolean(note, "calendar:weekNumbers");
|
||||
const [ calendarView, setCalendarView ] = useNoteLabel(note, "calendar:view");
|
||||
const initialDate = getCustomisableLabel(note, "initialDate", "calendar:initialDate");
|
||||
const [ initialDate ] = useNoteLabel(note, "calendar:initialDate");
|
||||
const initialView = useRef(calendarView);
|
||||
const viewSpacedUpdate = useSpacedUpdate(() => setCalendarView(initialView.current));
|
||||
useResizeObserver(containerRef, () => calendarRef.current?.updateSize());
|
||||
@ -135,7 +135,7 @@ export default function CalendarView({ note, noteIds }: ViewModeProps<CalendarVi
|
||||
height="90%"
|
||||
nowIndicator
|
||||
handleWindowResize={false}
|
||||
{ ...(initialDate ? {initialDate: initialDate} : undefined)}
|
||||
initialDate={initialDate || undefined}
|
||||
locale={locale}
|
||||
{...editingProps}
|
||||
eventDidMount={eventDidMount}
|
||||
|
||||
@ -33,6 +33,7 @@ type Labels = {
|
||||
"calendar:hideWeekends": boolean;
|
||||
"calendar:weekNumbers": boolean;
|
||||
"calendar:view": string;
|
||||
"calendar:initialDate": string;
|
||||
"map:style": string;
|
||||
"map:scale": boolean;
|
||||
"board:groupBy": string;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user