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

Calendar incorrect time validation #7381

Closed
polushinmk opened this issue Mar 14, 2019 · 1 comment
Closed

Calendar incorrect time validation #7381

polushinmk opened this issue Mar 14, 2019 · 1 comment
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@polushinmk
Copy link
Contributor

polushinmk commented Mar 14, 2019

this is continue of task #7232
I'm submitting a ... (check one with "x")

[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior

create p-calendar control with minDate and maxDate restrictions and in timeonly mode.
MaxDate (for example) setted as 4 hours and 0 minutes (04:00)
Click 3 times on hour increment arrow -> control shows 03:00
next click on minute increment arrow -> control show 03:15
nex click on hour increment arrow -> control show 04:15

Expected behavior

while clicking on minute hour increment arrow date not changed

Minimal reproduction of the problem with instructions

<p-calendar [timeOnly]="true" [stepMinute]="15" [readonlyInput]="true" [(ngModel)]="duration" [minDate]="minDuration" [maxDate]="maxDuration"></p-calendar>
public minDuration: Date = new Date(0, 0, 0, 0, 15, 0, 0); // min allowed time is 0:15
public maxDuration: Date = new Date(0, 0, 0, 4, 0, 0, 0); // max allowed time is 4:00

First: choose max-1 hour (in this example 3:00)
Second: click on minute increment arrow - result will be 3:15 - OK
Third: click on hour increment arrow
Result: time will be 4:15 - invalid value

What is the motivation / use case for changing the behavior?

bug
that happens because hours, minutes and seconds validates independently. seems that there should be one method like validateTime that will be validate all time components together
Please tell us about your environment:

Windows 10, VS Code, npm, ng serve

  • Angular version: 5.X

7.2

  • PrimeNG version: 5.X

7.1.0

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

all

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    TS 3
  • Node (for AoT issues): node --version =
@thomasesh
Copy link

So this fix is targeted for 9.0.2 and is 9.0.2 still targeted for March 25?

@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Mar 27, 2020
cagataycivici added a commit that referenced this issue Mar 27, 2020
Fix for #7388 Fixing am/pm hour validation and #7381 Calendar incorre…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

4 participants