A minor bug, but I just now encountered it.
The minTime and maxTime required properties are set incorrectly, thus always showing even if The Field-Type isn’t set to datepicker after the timesetting was toggled to true.
Form Element line 580 - 606
'time' => [
'label' => esc_html__( 'Enable time', 'bricks' ),
'type' => 'checkbox',
'required' => [ 'type', '=', 'datepicker' ],
],
'l10n' => [
'label' => esc_html__( 'Language', 'bricks' ),
'type' => 'text',
'inline' => true,
'description' => '<a href="https://github.com/flatpickr/flatpickr/tree/master/src/l10n" target="_blank">' . esc_html__( 'Language codes', 'bricks' ) . '</a> (de, es, fr, etc.)',
'required' => [ 'type', '=', [ 'datepicker' ] ],
],
'minTime' => [
'label' => esc_html__( 'Min. time', 'bricks' ),
'type' => 'text',
'placeholder' => esc_html__( '09:00', 'bricks' ),
'required' => [ 'time', '!=', '' ],
],
'maxTime' => [
'label' => esc_html__( 'Max. time', 'bricks' ),
'type' => 'text',
'placeholder' => esc_html__( '20:00', 'bricks' ),
'required' => [ 'time', '!=', '' ],
],
If you once set your Field type to datepicker and check the timeoption the fields appear, and don’t disappear once the Field type has been set to anything else. This should be a minor fix by just setting the required property for minTime and maxTime to something like this (not tested, but just a guess):
'minTime' => [
'label' => esc_html__( 'Min. time', 'bricks' ),
'type' => 'text',
'placeholder' => esc_html__( '09:00', 'bricks' ),
'required' => [[ 'time', '!=', '' ],[ 'type', '=', 'datepicker' ]],
],
And by the way - if you fix this, I know this is probably the wrong place and more like a feature request but it would be awesome if we could have a time-picker without date ![]()
Best regards
Suat