Page 1 of 1

Wrong date with yy.mm.dd date format

Posted: 18 Aug 2019, 08:29
by rosenb
Typing date with dateFormat="yy.mm.dd" gives wrong date, in day section automatically inserts leading zero and cannot be typed e.q. "23" to day, it forces "02" when "2" is pressed. And without specifying dateFormat in the component it gives date in default format, however it's set in "hu" locale.
// hungarian special chars cause mysql error when saving topic, so replaced with "..."

Component:
Calendar v-model="myDate" :showIcon="true" :locale="hu" :showOnFocus="false" dateFormat="yy.mm.dd"

function returns "hu" data:
return {
firstDayOfWeek: 1,
dayNames: [...],
dayNamesShort: [...],
dayNamesMin: [...],
monthNames: [ ...],
monthNamesShort: [...],
today: '...',
clear: '...',
dateFormat: 'yy.mm.dd',
weekHeader: 'Wk'
}

Re: Wrong date with yy.mm.dd date format

Posted: 21 Aug 2019, 14:18
by cagatay.civici
Isn't this expected, from the docs;

y - year (two digit)
yy - year (four digit)

So double y means four digits so zeros are added.