Input type for AutoForm for Tempus Dominus datetime picker [https://github.com/Eonasdan/tempus-dominus]
Example usage in Schema declaration :
birthday: {
type: Date,
optional: true,
label: 'Birthday',
autoform: {
type: 'tempusdominus',
readonly: false,
dateTimePickerOptions: {
defaultDate: DateTime.fromFormat('2000-01-01', 'yyyy-MM-dd').toJSDate(),
display: {
sideBySide: false,
components: {
decades: true,
year: true,
month: true,
date: true,
hours: false,
minutes: false,
seconds: false
},
viewMode: 'years',
inline: false
}
},
localization: {
locale: 'en-GB', // should be set already on TempusDominus level
format: 'LL' // choose the format you want to display in the input field (formats predefined in TempusDominus)
}
}
}
The package uses a global.pickers variable to keep track of active DateTime picker instances to retrieve value in valueOut function. This implementation assumes that you have a global variabel TempusDominus at the start of the application. See TempusDominus documentation for setup of default options and localization.