javascript - Strange bug with date input and angular -


i'm working on angular based app , have strange bug.. when use:

<input type="date" ng-model="date"> 

the $scope.date has 1 day delay...

when try run attachment code prints date have selected 1 day delay :(
can do?!

thank :)

var app = angular.module('app', []);    app.controller('ctrl', ['$scope', function($scope){  }])
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>      <body ng-app="app">    <body ng-controller="ctrl">      <input type="date" ng-model="date">      {{ date }}              </body>    </body>

i think similar issue : jquery datepicker off 1 day

i have solved using momentjs library. provides lots of time-zone methods.

moment.utc([year, month, day])._d 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -