Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimeSlider does not work well with maxDate #607

Open
JNBG opened this issue May 5, 2024 · 3 comments
Open

TimeSlider does not work well with maxDate #607

JNBG opened this issue May 5, 2024 · 3 comments

Comments

@JNBG
Copy link

JNBG commented May 5, 2024

Options used for the Init:

let options:any = {
    altField: input.prev()[0],
    locale: localeDe,
    options.selectedDates = [1713330000000];
    options.altFieldFormat = 'T';
    options.dateFormat = 'dd.MM.yyyy';
    options.timeFormat = 'HH:mm';
    options.timepicker = true;
    options.minDate = new Date('2024-04-01 06:00');
    options.maxDate = new Date('2024-04-30 18:00');
};

Bug 1: Max Date can be set out of Bounds

  1. Set a maxDate Option to e.g. "2024-04-30 18:00"
  2. Select an earlier Day
  3. Set Hours to anything below 18 (Minutes don't really matter)
  4. Select configured max Date (2024-04-30 from above)
  5. MinuteSlider is now unlocked and the date can be set to "2024-04-30 18:59", so up to 59mins over the Max.
    => Expected Behaviour would be the Minute Slider to lock to 0 with the hour 18 selected

Bug 2: Minutes can't be selected after maxDate locked

  1. Set a maxDate Option to e.g. "2024-04-30 18:00"
  2. Select an earlier Day
  3. Set Hours to anything above 18 (Minutes don't really matter)
  4. Select configured max Date (2024-04-30 from above)
  5. As expected Time is auto-set to 18:00 and MinuteSlider is locked
  6. Select an Hour below 18
  7. Minute-Slider does not unlock to allow selection of e.g. 17:59
    => Expected Behaviour would be for the Miunte Slider to lock/unlock dynamically on selection of the Hourslider

I hope you can add a Fix for this, as otherwise the Picker is doing a formidable Job :)

@t1m0n
Copy link
Owner

t1m0n commented May 7, 2024

Hi, I'll try to check it. Did you try to use maxMinutes \ maxHours options?

@JNBG
Copy link
Author

JNBG commented May 9, 2024

I did not, I thought those were for limiting each day and not just setting a max/min date

@14nd90
Copy link

14nd90 commented Jun 1, 2024

+1 also having this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants