Botanique/src/utils/time.ts

17 lines
343 B
TypeScript
Raw Normal View History

/**
* Parsed string adapted with TZ (locales) and format for the specified lang.
* @param tz Lang
* @param locale Locales
* @param date Date
* @returns String
*/
export const showDate = (
tz: string,
locale: Map<string, unknown>,
date: Date
) => {
return date.toLocaleString(tz).replace(' ', ` ${
locale.get('u_time_at')
} `);
};