DatePicker
<div id="pg_date"
data-win-control="HFWinJSCtrl.DatePicker"
data-win-options="{
defaultValue: 'now',
required: true,
label: 'Date',
emptyContent : 'Select...',
list: true
}">
</div>
FormControl Options
Options of the kendo component are also available. read more
convertToLocalDate
If set to true, the selected date is converted to the local date of the device.
convertToLocalDate: true
boolean
defaultValue
Use the value "now" to offer the current ('local') date. A custom code function can be used to set defaultValue.
defaultValue: 'now'
string | function
function() => string | Date
disableCalendar
Set "true" whenever the DatePicker control calendar flyout should be disabled.
disableCalendar: true
boolean
disabled
Set "true" whenever the DatePicker should be disabled.
disabled: true
boolean
displayValueFormat
To change the format of the displayed date. For more information visit: https://docs.telerik.com/kendo-ui/framework/globalization/dateformatting.
displayValueFormat: 'dd.MM.yyyy'
string
doNotCopy
Set "true" whenever the field should get deleted if form is copied.
doNotCopy: true
boolean
emptyContent
Write a short word to indicate that the appropriate date can/must be chosen.
emptyContent: 'Select ...'
string
list
Set this property to "true" if data connected with this control should be a sorting/filtering/grouping option on the listpage, is used in template objects (eg. the listTemplate) or it should show up in admin ui listings.
list: true
boolean
listOptions
Set additional options for controls with list equals true. E.g. set custom label for filter/sort/group dialogs or hide them complettely.
listOptions: {...}
{ dialogText: string, dialogHide: boolean }
max
Set to allow entries up to until this date. With "now" the newest possible entry is the current day. Format for fixed dates is yyyy-MM-dd
max: 'now'
string
min
Set to allow entries from that date on. Format is yyyy-MM-dd.
min: '1965-05-14'
string
1900-01-01
mobilePicker
Use native date picker on mobile devices. There are settings restrictions e.g. formatting or start interval.
mobilePicker: true
boolean
onChanged
Call a pre-defined JS-method to do something when the status of the control changes
onChanged: HFFormdefinition.Namespace.Method
function
function(value: Date) => void
parseFormats
Used to give the user several format options to type in the date. "Converts" the date to format which is set with displayValueFormat.
parseFormats: ['ddMMyyyy', 'dd/MM/yyyy', 'dd-MM-yyyy']
string[]
persistent
The value "user" sets the initial value of the DatePicker to the value of the previous form item of the current user and overwrites any defaultValue.
persistent: 'user'
'user'
start
Used to control with which area the DatePicker view starts when opened. Allowed values: month / year / decade / century
start: 'decade'
month | year | decade | century
month
tooltip
Write a comment to provide further information about the field. A question mark will then be shown within the label and with a click/tap on it, the information will occur.
tooltip: 'Please indicate at least one cause of damage.'
string
tooltipTemplate
Write an id of a html container to provide further information about the field. A question mark will then be shown within the label and with a click/tap on it, the content of the container will occur.
tooltipTemplate: 'example_control_tooltip'
string
visiting
Set "true" whenever the form element should be marked as "visited" when the user has clicked or tapped at the form field.
visiting: true
boolean
listOptions Object
dialogText
Set custom label for filter/sort/group dialogs.
dialogText: 'Display Text'
string
copyValueTo
Define FormControls in which the entered value should be copied.
<div id="datepicker_field_copy_source"
data-win-control="HFWinJSCtrl.DatePicker"
data-win-options="{
label: 'DatePicker: source',
displayValueFormat: 'dd.MM.yyyy',
parseFormats: ['dd.MM.yyyy', 'ddMMyyyy', 'dd/MM/yyyy', 'dd-MM-yyyy', 'd.M.yy', 'ddMMyy', 'd/M/yy', 'd-M-yy'],
copyValueTo: [{
targetId: 'datepicker_field_copy_target_1'
}, {
targetId: 'datepicker_field_copy_target_2',
shadowPostfix: '_HFDate'
}]
}"></div>
interface ICopyValueToObject {
targetId: string;
mode: 'overwrite' | null;
shadowPostfix: string;
callback: (value: string) => string;
}
type CopyValueToType = string | ICopyValueToObject | Array<string | ICopyValueToObject>;
callback
Specify a function to process value before copy.
callback: HFFormDefinition.Namespace.processValue
function
function(value: string) => string
mode
Specify if target field gets overwritten. Default behviour is to only copy to empty fields.
mode: 'overwrite'
string
shadowPostfix
Specify which shadow field is copied.
shadowPostfix: '_HFNumericField'
string
Stored data
<div id="pg_date"
data-win-control="HFWinJSCtrl.DatePicker"
data-win-options="{
required: true,
emptyContent : 'Select...'
}">
</div>
For each DatePicker inside your forms there is one value pair of stored data. Date format according ISO 8601
{
"id": "pg_date",
"value": "2021-07-15T22:00:00.000Z"
}
{
"id": "pg_date_HFDate",
"value": "16. Jul. 2021"
}
{
"id": "pg_date_HFLocal",
"value": "2021-07-16T00:00:00.000+02:00"
}