On this page
Improve this Doc View Source input[date]
- input in module ng
Input with date validation and transformation. In browsers that do not yet support the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601 date format (yyyy-MM-dd), for example: 2009-01-06
. Since many modern browsers do not yet support this input type, it is important to provide cues to users on the expected input format via a placeholder or label.
The model must always be a Date object, otherwise Angular will throw an error. Invalid Date
objects (dates whose getTime()
is NaN
) will be rendered as an empty string.
The timezone to be used to read/write the Date
instance in the model can be defined using ngModelOptions. By default, this is the timezone of the browser.
Directive Info
- This directive executes at priority level 0.
Usage
<input type="date"
ng-model="string"
[name="string"]
[min="string"]
[max="string"]
[ng-min=""]
[ng-max=""]
[required="string"]
[ng-required="string"]
[ng-change="string"]>
Arguments
Param | Type | Details |
---|---|---|
ngModel | string |
Assignable angular expression to data-bind to. |
name
(optional)
|
string |
Property name of the form under which the control is published. |
min
(optional)
|
string |
Sets the |
max
(optional)
|
string |
Sets the |
ngMin
(optional)
|
date string |
Sets the |
ngMax
(optional)
|
date string |
Sets the |
required
(optional)
|
string |
Sets |
ngRequired
(optional)
|
string |
Adds |
ngChange
(optional)
|
string |
Angular expression to be executed when input changes due to user interaction with the input element. |
© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.5.11/docs/api/ng/input/input%5Bdate%5D