mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 04:08:11 +00:00
Passenger portal build issue resolution
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import { format, toZonedTime } from 'date-fns-tz';
|
||||
|
||||
const ADDIS_TZ = 'Africa/Addis_Ababa';
|
||||
import { format } from 'date-fns';
|
||||
|
||||
export const formatCurrency = (amount: number, currency: string = 'ETB'): string => {
|
||||
return new Intl.NumberFormat('en-US', {
|
||||
@@ -11,16 +9,13 @@ export const formatCurrency = (amount: number, currency: string = 'ETB'): string
|
||||
};
|
||||
|
||||
export const formatDate = (date: string | Date, formatStr: string = 'MMM dd, yyyy'): string => {
|
||||
const zonedDate = toZonedTime(new Date(date), ADDIS_TZ);
|
||||
return format(zonedDate, formatStr, { timeZone: ADDIS_TZ });
|
||||
return format(new Date(date), formatStr);
|
||||
};
|
||||
|
||||
export const formatDateTime = (date: string | Date): string => {
|
||||
const zonedDate = toZonedTime(new Date(date), ADDIS_TZ);
|
||||
return format(zonedDate, 'MMM dd, yyyy HH:mm', { timeZone: ADDIS_TZ });
|
||||
return format(new Date(date), 'MMM dd, yyyy HH:mm');
|
||||
};
|
||||
|
||||
export const formatTime = (date: string | Date): string => {
|
||||
const zonedDate = toZonedTime(new Date(date), ADDIS_TZ);
|
||||
return format(zonedDate, 'HH:mm', { timeZone: ADDIS_TZ });
|
||||
return format(new Date(date), 'HH:mm');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user