Reputation:
I'm using datepicker. The problem I'm having is that the year is giving me 4 digits.
$.datepicker.setDefaults({
dateFormat: 'dd-mm-yy'
});
Shouldn't yy give me only 2 digits?
How do I get 2 digits on the year instead of 4?
Upvotes: 1
Views: 805
Reputation: 6329
This is about JQuery. Docs: http://api.jqueryui.com/datepicker/
y - year (two digit)
yy - year (four digit)
So:
$.datepicker.setDefaults({
dateFormat: 'dd-mm-y'
});
Upvotes: 2
Reputation: 1446
Use single y
$.datepicker.setDefaults({
dateFormat: 'dd-mm-y'
});
Source: https://api.jqueryui.com/datepicker/
Upvotes: 1