Skip to content

Commit 1d3224f

Browse files
authored
Merge pull request #1195 from e-mission/fix-substring-missing-fmt-time
🐛 fix UI error when enter_fmt_time or exit_fmt_time missing
2 parents 9a6ae19 + df131c4 commit 1d3224f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

www/js/diary/useDerivedProperties.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ const useDerivedProperties = (tlEntry) => {
1919
const beginDt = tlEntry.start_local_dt || tlEntry.enter_local_dt;
2020
const endDt = tlEntry.end_local_dt || tlEntry.exit_local_dt;
2121
// given YYYY-MM-DDTHH:MM:SSZ strings: if YYYY-MM-DD differs, is multi-day
22-
const tlEntryIsMultiDay = beginFmt.substring(0, 10) != endFmt.substring(0, 10);
22+
const tlEntryIsMultiDay =
23+
beginFmt && endFmt ? beginFmt?.substring(0, 10) != endFmt?.substring(0, 10) : false;
2324

2425
return {
2526
confirmedMode: confirmedModeFor(tlEntry),

0 commit comments

Comments
 (0)