Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

datetimepicker - wrong validatio #3937

Closed
agrudz opened this issue Jul 13, 2015 · 4 comments
Closed

datetimepicker - wrong validatio #3937

agrudz opened this issue Jul 13, 2015 · 4 comments

Comments

@agrudz
Copy link

agrudz commented Jul 13, 2015

I use datepicker and i'm trying to type date using keyboard. The specified format for datetimepicker is yyyy-MM-dd. When i type whole data it works correct. when i tries to change for examle month it starts to fail.
The path to the bug looks like this:

  1. I have correct date in my datetimepicker for example 2015-07-14
  2. I whant to change it to 2015-08-14 so i start editing it and im removing 7 - i have 2015-0-14 writen in my datetimepicker. The validation shows me that it is not correct date ant this is fine for me
    3.I type 8 and i have 2015-08-14 in my datetimepicker. The validation message still shows up...
    There is a screen from my debuger -
    debuger
    You can notice that houres, minutes and seconds have NaN values. The bug is easy to correct.
    I edited this piece of code
    i replace this :
    if ( isValid(fields.year, fields.month, fields.date) ) {
    dt = new Date(fields.year, fields.month, fields.date, fields.hours, fields.minutes, fields.seconds,
    fields.milliseconds || 0);
    }
    with:
   dt = new Date(fields.year, fields.month, fields.date, fields.hours || 0, fields.minutes || 0, fields.seconds || 0,
      fields.milliseconds || 0);
@goliney
Copy link

goliney commented Jul 13, 2015

I have problems with direct input editing too. Here is plunkr with bug description:
http://plnkr.co/edit/SJpireJtJfTmeK80QmGi?p=preview

@inaccessible
Copy link

+1

1 similar comment
@zlailari
Copy link

+1

@wesleycho
Copy link
Contributor

This is a duplicate of #3713 . I believe that #3759 will address this.

@wesleycho wesleycho modified the milestones: 0.13.1 (Performance), 0.13.1 (npm), 0.13.2 (Performance) Jul 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants