You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
369 B
13 lines
369 B
2 years ago
|
import { format } from 'date-fns';
|
||
|
|
||
|
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm';
|
||
|
const DATE_FORMAT = 'YYYY-MM-DD ';
|
||
|
|
||
|
export function formatToDateTime(date: Date | number, formatStr = DATE_TIME_FORMAT): string {
|
||
|
return format(date, formatStr);
|
||
|
}
|
||
|
|
||
|
export function formatToDate(date: Date | number, formatStr = DATE_FORMAT): string {
|
||
|
return format(date, formatStr);
|
||
|
}
|