Conversation
|
Here is some code to reproduce in a JS console: |
|
hi @joliss, the problem here is that TimePicker stores the selected time in a private variable that gets updated when the setTime API method is updated or the change event is triggered. Calling the If I try to use always the actual value of the input field as the selected time there may be a lost of information, and I'm not sure if that's acceptable. Let me try to explain: Using the private variable, if you call setTime method to set the time to '11:40:34 PM', that's the value stored in the interval variable; the hour, minutes and seconds are all preserved. Now consider the time format for our example timepicker is set to Using the stored value, when you call That's the loss of information I'm concerned about and some of the tests are failing because of that. I need to decide whether to update the tests to ignore the loss of data, possibly harming users of previous versions or giving up on considering the input field's value and encourage users to use setTime to alter the time of their timepickers. What do you think about this? Is there a third solution that I'm not considering? I really appreciate your feedback. Thank you. |
|
Hey Willington, Sorry for the long delay. I see your point about losing information. As a user of timepicker, I wouldn't be surprised if it lost information when the granularity of my field is lower. In other words, if I need seconds, I'd always have the seconds show. That said, you obviously can't break it for existing users. Now having to call Because of that, my suggestion would be to change it and then bumping the major version to 2.0.0. Following semantic versioning, people should expect backwards-incompatible changes between major versions. That said, it's up to you obviously. If you think preserving information is a critical feature, then leaving it as it is (and perhaps removing my failing test) would be the best course of action I can think of. |
AFAIK, I managed to avoid the loss of precision discussed in #24 (comment).
Calling
.val()on the input field followed bytimepicker('getTime')does not return the new time.I stumbled on this while writing unit tests for my app. I'm attaching a failing test case.