From 56d4a677a5e8b0e42a40b373a04d8819d53cad8d Mon Sep 17 00:00:00 2001 From: Stefan Sundin Date: Fri, 2 Apr 2021 22:47:23 -0700 Subject: [PATCH] Also format the "Automatic dark mode" clocks. --- ui/page/settings/view.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/page/settings/view.jsx b/ui/page/settings/view.jsx index 4cb05edcd..57bcb4610 100644 --- a/ui/page/settings/view.jsx +++ b/ui/page/settings/view.jsx @@ -145,7 +145,11 @@ class SettingsPage extends React.PureComponent { this.props.setDarkTime(value, options); } - to12Hour(time: string) { + formatHour(time: string, clock24h: boolean) { + if (clock24h) { + return `${time}:00`; + } + const now = new Date(0, 0, 0, Number(time)); const hour = now.toLocaleTimeString('en-US', { hour12: true, hour: '2-digit' }); @@ -292,7 +296,7 @@ class SettingsPage extends React.PureComponent { > {startHours.map((time) => ( ))} @@ -305,7 +309,7 @@ class SettingsPage extends React.PureComponent { > {endHours.map((time) => ( ))}