Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(datepicker): dereference date initialization
Browse files Browse the repository at this point in the history
- Dereference the date set to active date to prevent model automatically
  updating from equal reference
  • Loading branch information
wesleycho committed Mar 17, 2016
1 parent 316e96c commit 7446c2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst
ngModelCtrl = ngModelCtrl_;
ngModelOptions = ngModelCtrl_.$options || datepickerConfig.ngModelOptions;

this.activeDate = ngModelCtrl.$modelValue || new Date();
this.activeDate = dateParser.fromTimezone(new Date(ngModelCtrl.$modelValue), ngModelOptions.timezone) || dateParser.fromTimezone(new Date(), ngModelOptions.timezone);

ngModelCtrl.$render = function() {
self.render();
Expand Down

0 comments on commit 7446c2d

Please sign in to comment.