0

I am using pikaday.js date picker. I have moment.js loaded as well.

If i select 02/02/2022 it stored fine but when the page loads it changes changes the date to a random date.

var qualExpiry = new Pikaday({
    field: document.getElementById('qualExpiry'),
    firstDay: 1,
    format: 'DD-MM-YYYY',
    yearRange: [2010, 2040]
});
{!! Form::text('expiry_date', null, ['id' => 'qualExpiry', 'class' => 'form-control form-control-lg form-control-solid mb-3 mb-lg-0', 'placeholder' => 'Select expiry date']) !!}

if i remove format: 'DD-MM-YYYY' and use the default ISO format it works fine

4

0 回答 0