Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular DatePicker - Unable to get the accurate date in controller #320

Open
chinmay235 opened this issue Feb 2, 2017 · 1 comment
Open

Comments

@chinmay235
Copy link

chinmay235 commented Feb 2, 2017

I have faced datepicker issue can you please see https://angularjscript.github.io/angularjs-datepicker/chinu.html link. When I am selecting any date I am getting previous date from the input date. I select 2017-02-15 I am getting "due_date": "2017-02-14T19:00:00.000Z" in my controller.

2017-02-02_183604

Thanks
@chinmay235

@chinmay235 chinmay235 changed the title Angular DatePicker not get the correct date in controller Angular DatePicker not get the accurate date in controller Feb 2, 2017
@chinmay235 chinmay235 changed the title Angular DatePicker not get the accurate date in controller Angular DatePicker - Unable to get the accurate date in controller Feb 2, 2017
@chinmay235
Copy link
Author

chinmay235 commented Feb 9, 2017

I got one solution for getting accurate date. Here is my code:

<input type="datetime" class="form-control" name="due_date" date-time view="date" format="YYYY-MM-DD" auto-close="true" min-view="date" ng-model="formData.due_date" readonly="" required="" date-change="changeDueDate" />


$scope.changeDueDate = function (modelName, newDate) {
          console.log(modelName + ' has had a date change. New value is ' + newDate.format());
          $scope.formData.due_date = newDate.format();
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant