Passenger portal build issue resolution

This commit is contained in:
Stephanos A
2026-06-03 16:14:41 +03:00
parent f4051aadfc
commit 8a9cc8afff
13 changed files with 17 additions and 341 deletions

View File

@@ -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');
};