Skip to content

DatePicker: Minutes increment allows to set time before minDate #8233

@tpt-ldelay

Description

@tpt-ldelay

Describe the bug

When using a DatePicker with time and a min date, the increment minutes button allows to increment up to 00, setting a time before the minDate.

It seems there's an inconsistency between increment and decrement function as seen here

Image

I think the modulo of newMinute should be calculated before validation, as in the decrement function. In the current state, it can try to validate 60 against minMinutes, which is always true.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-gke4qbwd?file=src%2FApp.vue

Environment

N/A

Vue version

3.5.13

PrimeVue version

4.3.7

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

Within the provided StackBlitz:

  1. Open the DatePicker
  2. Try to increment minutes past 59

Expected behavior

The increment button should not allow to go "up" to 00 as it then set a time before the set minDate

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions