I'm trying to setup pickadate on two inputs.When a date is selected on the first input, i would like to set the selected date in the second input if the 2nd is empty.
First I tried to update the value after the first input is selected but something doesn't work correclty.
The configuration of both input is complexe so i would like to do it this way :
$( '#event-begin-date,#event-end-date' ).pickadate({
min: true,
max: undefined,
today: '<?php echo T_("Aujourd\'hui"); ?>',
clear: '<?php echo T_("Effacer"); ?>',
close: '<?php echo T_("Fermer"); ?>',
format: '<?php echo T_("dd/mm/yyyy"); ?>',
firstDay: <?php echo T_("1"); ?>,
formatSubmit: '<?php echo T_("dd/mm/yyyy"); ?>'
});
$('#event-begin-date').pickadate({
onSet: function(thingSet) {
var picker = $input.pickadate('picker');
picker.set('select', this.component.item.select.pick );
}
});