foundation-datepicker
foundation-datepicker copied to clipboard
format:'mm/dd/yyyy' does not format initial value of form field
When using date picker in an edit form field, the field value does not honour the format:'mm/dd/yyyy' setting. When you click the field to open date picker, and then click off it to close it, it does change the format then.
So this field displays the value as 2019-09-23 even though format format: 'dd/mm/yyyy' is used.
<input type="text" id="startDate" name="fields[startDate]" class="date-picker" value="2019-09-23">
// Date Picker Fields
if( $('.date-picker').length > 0 )
{
$('.date-picker').fdatepicker({
format: 'dd/mm/yyyy',
disableDblClickSelection: true,
leftArrow:'<<',
rightArrow:'>>',
closeIcon:'X',
closeButton: true
});
}