Skip to content

Commit

Permalink
⏰ Improved timezone conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
wiki-Bird committed Nov 28, 2023
1 parent 8895478 commit a464332
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/commands/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ const convert: Command = {
timeString = currentTime.toFormat("HH:mm");
}

switch (timezoneFrom) {
case "NZT" || "NZDT": timezoneFrom = "Pacific/Auckland"; break;
case "AEST" || "AEDT" || "AET": timezoneFrom = "Australia/Sydney"; break;
case "ACST" || "ACDT" || "ACT": timezoneFrom = "Australia/Adelaide"; break;
case "AWST": timezoneFrom = "Australia/Perth"; break;
}

// Check for AM/PM in the time string
const isAmOrPm = timeString.includes('am') || timeString.includes('pm');

Expand Down

0 comments on commit a464332

Please sign in to comment.