How to set the date and location of the <aui: input> quote tag in Liferay 6.2 CE GA2?

Currently, I cannot set the <aui:input>tag calendar date and locale format:

  • It still shows an empty non-localized input pattern (mm / dd / yyyy)
  • When you click on the calendar expansion, the selected date is always executed NOW, even if the value is specified Date
  • When a date is selected on the calendar, the input field is filled with the selected date, but in the wrong format (still like mm / dd / yyyy)

I cannot upload images or share multiple links because of my reputation, so I am combining these three cases mentioned above into one image in here .

This is what I am doing in my .jsp file now:

<%
Calendar calendar = CalendarFactoryUtil.getCalendar(themeDisplay.getTimeZone(), themeDisplay.getLocale());
Date date = new Date(571096800000l); // A random date different than NOW.
calendar.setTime(date);
System.out.println("calendar date = " + calendar.getTime()); // Fri Feb 05 22:00:00 GMT 1988

Format formatter = FastDateFormatFactoryUtil.getDate(themeDisplay.getLocale(), themeDisplay.getTimeZone());
String formattedDate = formatter.format(date);
System.out.println("formatted date = " + formattedDate); // formatted date = 5.02.88
%>

<aui:input type="date" name="test1" value="<%= calendar %>"/>
<aui:input type="date" name="test2" value="<%= calendar.getTime() %>"/>                 
<aui:input type="date" name="test3" value="<%= date %>"/>
<aui:input type="date" name="test4" value="<%= date.getTime() %>"/>
<aui:input type="date" name="test5" value="<%= date %>"/>
<aui:input type="date" name="test6" value="<%= date.getTime() %>"/>
<aui:input type="date" name="test7" value="<%= formattedDate %>"/>

Thanks so much for your time!

+4
2

, , AlloyUI Liferay = "", . , , Chrome, AlloyUI = "", Chrome HTML5 .

, AUI , - . dateeray-ui: date-date - , - , jQuery UI datepicker, , , .

, , , taglib, .

+4

.

< liferay-ui: - cssclass= "<% = cssClass% > "

dayNullable = "<% = dayNullable% > "

            dayParam='<%= fieldParam + "Day" %>'
             dayValue="<%= day %>"
             disabled="<%= disabled %>"
             firstDayOfWeek="<%= firstDayOfWeek %>"
             formName="<%= formName %>"
            imageInputId='<%= fieldParam + "ImageInputId" %>'
            monthNullable="<%= monthNullable %>"
            monthParam='<%= fieldParam + "Month" %>'
            monthValue="<%= month %>"
            yearNullable="<%= yearNullable %>"
            yearParam='<%= fieldParam + "Year" %>'
            yearRangeEnd="<%= yearRangeEnd %>"
            yearRangeStart="<%= yearRangeStart %>"
            yearValue="<%= year %>"
        />

+2
source

All Articles