On this page
Improve this Doc View Source input[week]
- input in module ng
Overview
Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 week format (yyyy-W##), for example: 2013-W02
.
The model must always be a Date object, otherwise AngularJS will throw an error. Invalid Date
objects (dates whose getTime()
is NaN
) will be rendered as an empty string.
The value of the resulting Date object will be set to Thursday at 00:00:00 of the requested week, due to ISO-8601 week numbering standards. Information on ISO's system for numbering the weeks of the year can be found at: https://en.wikipedia.org/wiki/ISO_8601#Week_dates
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="week"
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 AngularJS 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 |
AngularJS expression to be executed when input changes due to user interaction with the input element. |
Example
© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 3.0.
https://code.angularjs.org/1.8.2/docs/api/ng/input/input%5Bweek%5D