You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
feat(datepicker): allow date strings as the source for ng-model (#9554)
This change adds the ability to have a date string (e.g. "2016-01-02") as the source for the datepicker. Until now only Date objects were allowed.
Fixes#6253.
Fixes#9535.
Copy file name to clipboardExpand all lines: src/components/datepicker/js/datepickerDirective.js
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@
18
18
* @name mdDatepicker
19
19
* @module material.components.datepicker
20
20
*
21
-
* @param {Date} ng-model The component's model. Expects a JavaScript Date object.
21
+
* @param {Date} ng-model The component's model. Expects either a JavaScript Date object or a value that can be parsed into one (e.g. a ISO 8601 string).
22
22
* @param {Object=} ng-model-options Allows tuning of the way in which `ng-model` is being updated. Also allows
23
23
* for a timezone to be specified. <a href="https://docs.angularjs.org/api/ng/directive/ngModelOptions#usage">Read more at the ngModelOptions docs.</a>
24
24
* @param {expression=} ng-change Expression evaluated when the model value changes.
@@ -444,9 +444,18 @@
444
444
445
445
// Responds to external changes to the model value.
0 commit comments