Skip to content

Commit

Permalink
update timestamp logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanweiler92 committed Apr 2, 2024
1 parent 27b5541 commit 9b0307d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions web/js/components/timeline/kiosk-timestamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ function KioskTimeStamp({ date, subdaily, isKioskModeActive }) {
timeZone: 'America/New_York',
};

const updateKioskModeTime = isKioskModeActive && subdaily;

const isDaylightSavingsTime = getIsDaylightSavingsTime();
const formatter = new Intl.DateTimeFormat('en-US', options);
const dateParts = formatter.formatToParts(date);
Expand All @@ -40,10 +42,10 @@ function KioskTimeStamp({ date, subdaily, isKioskModeActive }) {
const dfDay = util.pad(date.getUTCDate(), 2, '0');
const dfHour = util.pad(date.getUTCHours(), 2, '0');

const year = isKioskModeActive ? kioskYear : dfYear;
const month = isKioskModeActive ? kioskMonth : dfMonth;
const day = isKioskModeActive ? kioskDay : dfDay;
const hour = isKioskModeActive ? kioskHour : dfHour;
const year = updateKioskModeTime ? kioskYear : dfYear;
const month = updateKioskModeTime ? kioskMonth : dfMonth;
const day = updateKioskModeTime ? kioskDay : dfDay;
const hour = updateKioskModeTime ? kioskHour : dfHour;

const minutes = dateParts.find((part) => part.type === 'minute').value;
const timeZoneLabel = isDaylightSavingsTime ? 'EDT' : 'EST';
Expand Down

0 comments on commit 9b0307d

Please sign in to comment.