feat(core): page info adapter for journal (#5561)

Page info adapter + schema.
Adapted for journal features.

![image](https://github.com/toeverything/AFFiNE/assets/584378/2731ed2b-a125-4d62-b658-f2aff49d0e17)
This commit is contained in:
Peng Xiao
2024-01-22 08:25:27 +00:00
parent 8b92cc0cae
commit 735e1cb117
18 changed files with 412 additions and 68 deletions
@@ -1,3 +1,4 @@
export * from './create-emotion-cache';
export * from './intl-formatter';
export * from './string2color';
export * from './toast';
@@ -0,0 +1,17 @@
const timeFormatter = new Intl.DateTimeFormat(undefined, {
timeStyle: 'short',
});
const dateFormatter = new Intl.DateTimeFormat(undefined, {
year: 'numeric',
month: 'short',
day: 'numeric',
});
export const timestampToLocalTime = (ts: string) => {
return timeFormatter.format(new Date(ts));
};
export const timestampToLocalDate = (ts: string) => {
return dateFormatter.format(new Date(ts));
};