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