how can i format jquery datepicker as “25-JAN-2009”

后端 未结 5 1228
盖世英雄少女心
盖世英雄少女心 2020-12-14 02:55

I would have thought this was:

.datepicker({ dateFormat: \'dd-mmm-yyyy\' });

for month, I get some number that I don\'t understnad where th

5条回答
  •  再見小時候
    2020-12-14 03:26

    You want:

    $('.selector').datepicker({ dateFormat: 'dd-M-yy' });
    

    See the docs.

    The date format strings are somewhat non-standard:

    d - day of month (no leading zero)
    dd - day of month (two digit)
    o - day of the year (no leading zeros)
    oo - day of the year (three digit)
    D - day name short
    DD - day name long
    m - month of year (no leading zero)
    mm - month of year (two digit)
    M - month name short
    MM - month name long
    y - year (two digit)
    yy - year (four digit)
    @ - Unix timestamp (ms since 01/01/1970)
    '...' - literal text
    '' - single quote
    anything else - literal text

提交回复
热议问题