amsul / pickadate.js

The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
http://amsul.ca/pickadate.js
MIT License
7.7k stars 1.01k forks source link

Cannot set format of date #974

Closed djpero closed 7 years ago

djpero commented 7 years ago

I can't set any format to datepicker, event submited, its always

1 January, 2017

Any suggestion, thanks!

Here is a code:

    var date_from = $('#date_from').pickadate({
        format: 'mm/dd/yyyy',
        formatSubmit: 'mm/dd/yyyy',
        selectYears: true,
        selectMonths: true
    });

    var picker_from = $('#date_from').pickadate('picker');
    picker_from.set('select', new Date(date.getFullYear(), 0, 1), {format: 'mm/dd/yyyy' });
djpero commented 7 years ago

It was my mistake, It was previously initialised.

zeeshan4971 commented 7 years ago

@djpero how did you fixed it i am having the same problem