mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-19 01:17:18 +02:00
15 lines
350 B
JavaScript
15 lines
350 B
JavaScript
const dateTimeOptions = {
|
|
day: '2-digit',
|
|
month: '2-digit',
|
|
year: 'numeric',
|
|
hour: '2-digit',
|
|
minute: '2-digit',
|
|
second: '2-digit',
|
|
};
|
|
export const formatFullDateTimeWithLocale = (v, locale, tz) => {
|
|
if (tz) {
|
|
dateTimeOptions.timeZone = tz;
|
|
}
|
|
return new Date(v).toLocaleString(locale, dateTimeOptions);
|
|
};
|