Skip to content

Commit a46e835

Browse files
committed
fixing some typescript error. tbh i'm not sure if this is good and typescript sucks
1 parent c9ec151 commit a46e835

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/HabitTracker.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
// Start with defaults
109109
let resolvedSettings = {
110110
path: userSettings.path || state.settings.path,
111+
firstDisplayedDate: '',
111112
lastDisplayedDate: userSettings.lastDisplayedDate || state.settings.lastDisplayedDate,
112113
daysToShow: userSettings.daysToShow !== undefined ? userSettings.daysToShow : state.settings.daysToShow,
113114
matchLineLength:
@@ -123,11 +124,11 @@
123124
// Apply smart firstDisplayedDate logic
124125
if (hasExplicitFirstDate) {
125126
// User provided firstDisplayedDate - use it directly
126-
resolvedSettings.firstDisplayedDate = userSettings.firstDisplayedDate
127+
resolvedSettings.firstDisplayedDate = userSettings.firstDisplayedDate!
127128
// If user also provided lastDisplayedDate, recalculate daysToShow to match the actual range
128129
if (hasExplicitLastDate) {
129-
const startDate = parseISO(userSettings.firstDisplayedDate)
130-
const endDate = parseISO(userSettings.lastDisplayedDate)
130+
const startDate = parseISO(userSettings.firstDisplayedDate!)
131+
const endDate = parseISO(userSettings.lastDisplayedDate!)
131132
resolvedSettings.daysToShow = eachDayOfInterval({ start: startDate, end: endDate }).length
132133
}
133134
} else if (hasExplicitDaysToShow || hasExplicitLastDate) {

0 commit comments

Comments
 (0)