Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: AUI Date picker date format
Dear All,My requirement is date format should be dd/MM/yyyy, i tried to setup from aui date picker mask value with difference variable (eg. %d/%m/%yyyy,%d/%m/%y%y, etc) but whenever i select from date picker then the format is showing only dd/MM/yy. I tried to look for aui document (https://alloyui.com/api/classes/A.DatePicker.html#attr_mask) it doesn't include the information i required. Please sugest which variable should i put to get yyyy. Thank you
AUI().use('aui-datepicker', function(A) {
new A.DatePicker({
trigger : '#<portlet:namespace/>datepicker',
mask: '%d/%m/%y',
popover : {
zIndex : 1
AUI().use('aui-datepicker', function(A) {
new A.DatePicker({
trigger : '#<portlet:namespace/>datepicker',
mask: '%d/%m/%y',
popover : {
zIndex : 1
I found it and 4 digit year number should put as %G in aui date picker script.https://alloyui.com/api/modules/datatype-date-format.html
https://alloyui.com/api/files/yui3_src_date_js_date-format.js.html#l34
<aui:script>
AUI().use('aui-datepicker', function(A) {
new A.DatePicker({
trigger : '#<portlet:namespace/>datepicker',
mask: '%d/%m/%G',
popover : {
zIndex : 1
}
});
});
</aui:script>
https://alloyui.com/api/files/yui3_src_date_js_date-format.js.html#l34
<aui:script>
AUI().use('aui-datepicker', function(A) {
new A.DatePicker({
trigger : '#<portlet:namespace/>datepicker',
mask: '%d/%m/%G',
popover : {
zIndex : 1
}
});
});
</aui:script>