adopted-ember-addons / adopted-ember-addons/ember-pikaday

Setting minDate and maxDate after date is selected clears selection

Offen
#530 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
156
Forks
164
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I have two date pickers that work together, the end date and the start date.

I want to set the minDate of the end date to the selection of the start date (because it cannot end before it starts) and vice versa.

This is how I am doing it:

```
onInputDateTo(date) {
...
const dateEndOfDay = new Date(date)
dateEndOfDay.setHours(23, 59, 59, 999)
this.maxDateFromAllowed = dateEndOfDay;
...
```

Notice how I use setHours to change to the end of the day to allow the selection of the same day.

No matter which day is selected, setting the `maxDateFromAllowed` will clear the selection of the start date.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

No file or test is named in the issue. Start by reproducing the two-picker flow described, including setting maxDate or minDate after selecting a date and allowing the same day on both pickers. Done means updating either bound no longer clears the existing selection while the stated date constraints remain enforced.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.