jonthornton / Datepair.js

A javascript plugin for intelligently selecting date and time ranges, inspired by Google Calendar.
https://www.jonthornton.com/Datepair.js
359 stars 85 forks source link

Datepair's timepicker allows invalid input #39

Closed abarbaspring closed 9 years ago

abarbaspring commented 9 years ago

Hi, I'm having a problem with the timepicker in the Datepair.

Actually, it is allowing invalid input such as 'kdgjlsklfdj' and this input is automatically converted into 00:00 hrs. I need that the timepicker does not allow such input, maybe invalidating the control.

Besides, once the invalid input is typed in the first timepicker, the datepair stops updating the second timepicker with the delta, even I put a valid time in the first timepicker.

jonthornton commented 9 years ago

I'm not able to reproduce this problem. Can you post a jsFiddle and step by step instructions to demonstrate the glitch?

abarbaspring commented 9 years ago

Hi, Jonh.

In fact, I have used your example from http://jonthornton.github.io/Datepair.js/

But I also put it on https://jsfiddle.net/mwmm3xkn/

So, let me explain the steps to reproduce the problem: 1) Select a date on the first date field. The second date field will be filled automatically. 2) Select an hour on the first time field. The second time field will be filled automatically. 3) (Error 1) Type adsfasdgkljl on the first time field. After losing focus the field is not invalidated. 4) (Error 2) If I select any time in the first time field now, the second time field is not updated anymore.

jonthornton commented 9 years ago

Error 1 is expected behavior - see comment on https://github.com/jonthornton/jquery-timepicker/issues/383.

Error 2 was a bug and should be fixed now. Thanks for posting a bug report!