Skip to content

Programmatically setting start date earlier than current selection in date range causes infinite loop #2963

@flynnplatt

Description

@flynnplatt

Prerequisites

  • I have searched for duplicate or closed issues.
  • I have validated my setup against the latest version on StackBlitz.
  • I have read the contributing guidelines.
  • I understand that only sponsored issues will be worked on and that if I wish to sponsor an issue, I will contact the owner FIRST.

Describe the issue

When attempting to programmatically set the start date of a date range to a date prior to the current start date, the validation step falls into an infinite loop.

StackBlitz demonstrating the issue

I believe the culprit lies here

In this case, when attempting to validate the date 2021-01-01 against the current range of 2022-01-01 - 2023-01-01 the loop starts at 2022-01-01 and adds one day until either it matches the target date (2021-01-01) or becomes an invalid date, neither of which ever happens. At minimum, if the desire is to only be able to programmatically set the date to within the currently selected bounds then it should also exit the loop when the stepped date equals the end date. I believe the preference would actually be for date ranges to simply check that the target date itself is valid.

StackBlitz fork

https://stackblitz.com/edit/tempus-dominus-v6-simple-setup-emykt4tw?file=index.js

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome

What version of are you using? You can find this information from the sample StackBlitz.

6.9.4

What your browser's locale? You can find this information from the sample StackBlitz.

en-US

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions