You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
vart=document.getElementById('t');t.value;// a stringt.valueAsDate;// a Date, provided the user gave valid input, otherwise null
this Date object is actually a bit corrupt because it will have a
local timezone offset, yet the moment it represents is what the user picked,
if he were in UTC on the day of the epoch. e.g.
if the user enters 1:00, then t.valueAsDate.getUTCHours() will be 1, t.valueAsDate.getUTCMinutes() will be 0, t.valueAsDate.getTime() will be 3600000. t.valueAsDate.getTimezoneOffset() will be 480 (i'm in PDT).
i believe that the way this api is supposed to be used is that
you're supposed to pay attention to getUTCHours(), getUTCMinutes(), and getTime()
and ignore the rest.
i.e. i believe you are supposed to take this Date object and pretend
that it's really a time interval.
then ctrl.t will be bound to a UTC DateTime object, which is unwieldy
if your goal is to combine this time with some date, especially a local date. e.g.
formatting t for display also requires pointless care.
since the javascript API seems to have been striving toward providing
a duration, but was limited, as javascript does not have a Duration class,
and since dart does have a Duration class, maybe it would be reasonable
to have a ng-bind-type of "duration" which would bind the ng-model to a Duration.
then your date-time picker code would look like this: