Activity timeline refactoring followup (#5835)

Following https://github.com/twentyhq/twenty/pull/5697, addressing
review
This commit is contained in:
Weiko
2024-06-12 16:21:30 +02:00
committed by GitHub
parent bd22bfce2e
commit ad6547948b
31 changed files with 607 additions and 293 deletions

View File

@ -0,0 +1,26 @@
import { parseDate } from '~/utils/date-utils';
export const formatToHumanReadableMonth = (date: Date | string) => {
const parsedJSDate = parseDate(date).toJSDate();
return new Intl.DateTimeFormat(undefined, {
month: 'short',
}).format(parsedJSDate);
};
export const formatToHumanReadableDay = (date: Date | string) => {
const parsedJSDate = parseDate(date).toJSDate();
return new Intl.DateTimeFormat(undefined, {
day: 'numeric',
}).format(parsedJSDate);
};
export const formatToHumanReadableTime = (date: Date | string) => {
const parsedJSDate = parseDate(date).toJSDate();
return new Intl.DateTimeFormat(undefined, {
hour: 'numeric',
minute: 'numeric',
}).format(parsedJSDate);
};