mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix(core): journal title's day tag may be invalid (#5703)
Fix [TOV-470](https://linear.app/affine-design/issue/TOV-470/journal-invalid-date)
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user