Skip to content

Commit

Permalink
fix(frontend): fix sunrise and sunset formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaVls committed Dec 21, 2021
1 parent bc8f953 commit fcda433
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/src/components/Conditions/Conditions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function unixToDate(
const miliseconds = unixTimestamp * 1000;
const date = new Date(miliseconds);

return date.toLocaleTimeString("en-GB", { timeZone });
return date.toLocaleTimeString("en-GB", { timeZone, hour12: true });
}

return "N/A";
Expand All @@ -26,13 +26,13 @@ function Conditions(): ReactElement {
const conditions = [
{
id: 1,
value: `${unixToDate(current?.sunrise, timeZone)} AM`,
value: `${unixToDate(current?.sunrise, timeZone).replace("am", "AM")}`,
name: "Sunrise",
icon: "wi:sunrise",
},
{
id: 2,
value: `${unixToDate(current?.sunset, timeZone)} PM`,
value: `${unixToDate(current?.sunset, timeZone).replace("pm", "PM")}`,
name: "Sunset",
icon: "wi:sunset",
},
Expand Down

0 comments on commit fcda433

Please sign in to comment.