Angular UI DatePicker adjusting for timezone

前端 未结 6 604
忘了有多久
忘了有多久 2020-12-08 04:19

I have a date stored as a Date in SQL Server. The date shows 4/24/2014 when I query in SQL. That is correct. The date is correctly brought over to the client side in UTC. To

6条回答
  •  天命终不由人
    2020-12-08 05:07

    Solution found here: https://github.com/angular-ui/bootstrap/issues/4837#issuecomment-203284205

    The timezone issue is fixed.

    You can use:

    ng-model-options="{timezone: 'utc'}"

    To get a datepicker without timezone calculation.

    EDIT: This solution does not work since version 2.x, however it did perfectly fine until then. I couldn't find a workaround and still am using version 1.3.3.

    EDIT 2: As Sébastien Deprez pointed out in the comments below, this has been fixed in version 2.3.1. I just tested it and it works great.

    
    

提交回复
热议问题