mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
4cdfd1b575
* 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>
25 lines
626 B
TypeScript
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);
|
|
};
|