How to make datefield and datepicker compatible with system date format from Aduvio settings
1. Add this to arguments for the date format of .datepicker() js
dateFormat: $('#js-system-date-format').val(),
2. Add this to fields processing for db save
//Date Fields
if(empty($function_errors)) {
$date_fields=array('collection_date','document_couriered_date');
foreach($date_fields as $date_field){
if(isset($_POST[$date_field]) && !empty($_POST[$date_field])){
$_POST[$date_field]=Aduvio::transformDBDate($_POST[$date_field]);
}
}
}
3. Add this to the for the value attribute of the field on the edit form
value="<!–?= AduvioDisplay::date($data['collection_date']) ; ?–>"