-
Notifications
You must be signed in to change notification settings - Fork 6.7k
timepicker variable date, hard to compare. #5722
Comments
@lmcmgig, please be respectful of our time by creating a minimally working plunker with the issue and proposed fix. You can use the plunker link in our demo page to get you 19% of the way there. |
Hi,
back-end code using it will be simplier. Plunker doesn't help in that case. |
This is a breaking change because instead of defaulting to now(), it's now defaulting to 01JAN1970 GMT... Can you please elaborate further in order to provide some justification....? |
Ok, maybe I'm just not following... |
For example, I'm using the date in a JSON. In the application I need to We can process at an higher layer, but everybody using the library will |
Ahhhh. I got it. Thanks. @wesleycho, @Foxandxss thoughts? |
Closing as won't support, or extremely vague/poorly worded - parsing the sentences hurts my head. We have decided that due to the special issue in #5485, we are recommending that the date object used in the timepicker is separate from any other date usage, and we will be requiring that users process the two models appropriately. |
Bug description:
timepicker create a new Date with the current time. Result if you try to compare the output without processing the date itself, the same time (i.e. 16h00) can be different. Using always the same time reference ease the comparaison.
Proposed code modification:
.controller('UibTimepickerController', ...
var selected = new Date(0), //or 86400000 if you don't like negative number when offsetting for the timezone and using getTime().
Version of Angular, UIBS, and Bootstrap
Angular 1.5.0
UIBS 1.2.4
Boostrap 3.3.6
The text was updated successfully, but these errors were encountered: