diff --git a/src/utils/time.ts b/src/utils/time.ts new file mode 100644 index 0000000..0243bbc --- /dev/null +++ b/src/utils/time.ts @@ -0,0 +1,16 @@ +/** + * Parsed string adapted with TZ (locales) and format for the specified lang. + * @param lang Lang + * @param locale Locales + * @param date Date + * @returns String + */ +export const showDate = ( + lang: string, + locale: Map, + date: Date +) => { + return date.toLocaleString(lang).replace(' ', ` ${ + locale.get('u_time_at') + } `); +};