Files
console/src/lib/helpers/date.ts
T
Arman 4cdfd1b575 feat: 1.0.0 appwrite support (#36)
* style: remove padding and x label

* feat: add new colors, play with opacity

* feat: moved options inside the componenet

* chore: bump css to 0.0.0-40

* disabled animations

* add bar chart

* feat: use charts in dashboard

* fix typings

* fix typing

* fix: some thigs

* refactor: chart components

* fix: remove function from charts

* fix: charts loading condition

* feat: 1.0.0 support

* fix: charts and project list

Co-authored-by: Torsten Dittmann <torsten.dittmann@googlemail.com>
2022-09-28 13:25:02 +02:00

25 lines
626 B
TypeScript

export const toLocaleDate = (datetime: string) => {
const date = new Date(datetime);
const options: Intl.DateTimeFormatOptions = {
year: 'numeric',
month: 'short',
day: 'numeric'
};
return date.toLocaleDateString('en', options);
};
export const toLocaleDateTime = (datetime: string) => {
const date = new Date(datetime);
const options: Intl.DateTimeFormatOptions = {
year: 'numeric',
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
hour12: false
};
return date.toLocaleDateString('en', options);
};