Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): journal title's day tag may be invalid (#5703)

Cats Juice387e292ed916
diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/journal-doc-title.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-editor/journal-doc-title.tsx
index 25aaebaf3d..bb9cf58b56 100644
--- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/journal-doc-title.tsx
+++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/journal-doc-title.tsx
@@ -1,19 +1,16 @@
import { useJournalInfoHelper } from '@affine/core/hooks/use-journal';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import type { Page } from '@blocksuite/store';
-import dayjs from 'dayjs';
import * as styles from './styles.css';
export const BlocksuiteEditorJournalDocTitle = ({ page }: { page: Page }) => {
- const { localizedJournalDate, isTodayJournal } = useJournalInfoHelper(
- page.workspace,
- page.id
- );
+ const { localizedJournalDate, isTodayJournal, journalDate } =
+ useJournalInfoHelper(page.workspace, page.id);
const t = useAFFiNEI18N();
// TODO: i18n
- const day = dayjs(localizedJournalDate).format('dddd');
+ const day = journalDate?.format('dddd') ?? null;
return (
<span className="doc-title-container">