dateTimePicker
This is a dateTime picker field for date/time/datetime values.
Please note, this field depend on the following library:

Special properties of field

Property
Default
Accepted values
Description
autocomplete
none
see doc
Indicates whether the value of the control can be automatically completed by the browser.
dateTimePickerOptions
{}
Object
Settings to dateTimePicker. Read more info from options
format
null
String or null
Format of the value of model. If null, use the Unix timestamp format (eg: 1462913010557). If a String, format the Date with moment (eg: format: "YYYY.MM.DD").
max
none
Number
Max value (need to use validators.number)
min
none
Number
Min value (need to use validators.number)
placeholder
none
String
Placeholder text for input field
readonly
false
Boolean
If true, the input field is read only

dateTimePickerOptions

@TODO

Usage

Field for date-of-birth with min, max limits and age calculator.

1
{
2
type: "dateTimePicker",
3
label: "DOB",
4
model: "dob",
5
required: true,
6
placeholder: "User's birth of date",
7
min: moment("1900-01-01").toDate(),
8
max: moment("2016-01-01").toDate(),
9
validator: validators.date,
10
11
dateTimePickerOptions: {
12
format: "YYYY-MM-DD"
13
},
14
15
onChanged: function(model, newVal, oldVal, field) {
16
model.age = moment().year() - moment(newVal).year();
17
}
18
}
Copied!

Date and time picker

1
{
2
type: "dateTimePicker",
3
label: "DT",
4
model: "dt",
5
dateTimePickerOptions: {
6
format: "YYYY-MM-DD HH:mm:ss"
7
}
8
}
Copied!

Time picker

1
{
2
type: "dateTimePicker",
3
label: "Start time",
4
model: "startTime",
5
format: "HH:mm:ss",
6
dateTimePickerOptions: {
7
format: "HH:mm:ss"
8
}
9
}
Copied!
The value will be formatted as "15:28:43".
Last modified 3yr ago