Skip to content

Commit

Permalink
Add default tz
Browse files Browse the repository at this point in the history
  • Loading branch information
ericboucher committed Jan 21, 2025
1 parent f5a8dda commit 397f99f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ export function formatInUTC(date: Date, fmt: string) {
* When additional countries will need to access this module, this function will have to be revisited
*/

function formatInLocalTime(date: Date, fmt: string): string {
const dateInLocalTime = new TZDate(date, 'Africa/Blantyre');
export function formatInLocalTime(
date: Date,
fmt: string,
timeZone: string = 'Africa/Blantyre',
): string {
const dateInLocalTime = new TZDate(date, timeZone);

return format(dateInLocalTime, fmt);
}
Expand Down

0 comments on commit 397f99f

Please sign in to comment.