Skip to content

Commit 83a06fc

Browse files
committed
fix(date-picker): preserve time from existing date when internalDate is present
1 parent 408ed7f commit 83a06fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dashboard/src/components/common/date-picker.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ export function DatePicker({
217217

218218
if (isToday) {
219219
selectedDate.setHours(23, 59, 59, 999)
220-
} else if (internalDate && !showTime) {
220+
} else if (internalDate) {
221+
// Preserve time from existing date (works for both showTime and !showTime)
221222
selectedDate.setHours(internalDate.getHours(), internalDate.getMinutes(), internalDate.getSeconds(), internalDate.getMilliseconds())
222223
} else {
223224
selectedDate.setHours(now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds())

0 commit comments

Comments
 (0)