The forms in In-Portal are built from blocks. There are blocks for almost any control that exists, e.g. checkbox, radio buttons, date pickers.
The control in questions is "inp_edit_date_time", that allows to specify date & time by:
- entering by hand in the corresponding inputs
- selecting using date picker control
When date picker is opened and user haven't specified any value in the associated inputs, then date/time of date picker control opening moment is used:
The only of fixing this is ability to specify default date/time for the picker control for cases, when no value is entered by user yet.
- the new "picker_default" field option would be implemented, that can have 2 type values:
- exact timestamp
- relative timestamp in any format supported by "strtotime" function (e.g. "midnight +1 day -1 second" would resolve to "23:59:59" of today)
- the new "picker" format would be added to "kDateFormatter" class, that would work like this:
- if field does have value take it
- if field doesn't have any value AND "picker_default" is specified, then use above rules to create desired timestamp
- format timestamp from above using default format of the field (as if empty "format" was specified instead of "picker")
- in the "inp_edit_date_time" control use "picker" format (instead of no format) for the hidden field, that name starts with "full_date_"