Skip to content

Commit 4de6784

Browse files
Fix date clamping
1 parent 78564b8 commit 4de6784

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Next
4+
- Fix broken month dropdown on Firefox
5+
- Fix unreliable clamping to min/max dates
6+
37
## 2.1.0 - 2022 Jul 31
48
- Add `browseWithoutSelecting` property
59
- Use well-supported `:focus` instead of `:focus-within`

src/lib/DatePicker.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
setValue(min)
4444
}
4545
function clamp(d: Date, min: Date, max: Date) {
46-
if (browseDate > max) {
46+
if (d > max) {
4747
return cloneDate(max)
48-
} else if (browseDate < min) {
48+
} else if (d < min) {
4949
return cloneDate(min)
5050
} else {
5151
return cloneDate(d)

0 commit comments

Comments
 (0)