angularjs - Angular UI DatePicker adjusting for timezone -


i have date stored date in sql server. date shows 4/24/2014 when query in sql. correct. date correctly brought on client side in utc. edit date we're using angular ui datepicker. datepicker adjusting date based on local timezone , off 1 day.

i can see it's happening. if editing datetime instead of date, correct adjust timezone. however, in case, have date, don't care timezone , want edit date in database.

i can verify it's adjusting timezone. if change timezone on windows machine utc datepicker show correct date.

so, question is, there way tell datepicker turn off timezone adjustments , manage dates in utc format work sql date instead of sql datetime?

i had similar problem while ago: wanted store local dates on server side (i.e. yyyy-mm-dd , no timezome/time information) since angular bootstrap datepicker uses javascript date object not possible (it serializes utc datetime string in json found out yourself).

i solved problem directive: https://gist.github.com/weberste/354a3f0a9ea58e0ea0de

essentially, i'm reformatting value whenever date selected on datepicker (this value, yyyy-mm-dd formatted string, stored on model) , whenever model accessed populate view, need wrap in date object again datepicker handles properly.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -