mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-31 13:49:12 +08:00
feat(core): page info adapter for journal (#5561)
Page info adapter + schema. Adapted for journal features. 
This commit is contained in:
@@ -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));
|
||||
};
|
||||
Reference in New Issue
Block a user