Date Picker in liferay
In Liferay it is simple to add the add the DatePicker. Liferay already had datepicker taglib, so here we go .
Creating the calendar object, for today date.
Calendar cal = CalendarFactoryUtil.getCalendar(timeZone, locale);
int startDateValue = cal.get(Calendar.DATE);
int startMonthValue = cal.get(Calendar.MONTH);
int startYearValue = cal.get(Calendar.YEAR);
Implementing the date picker,
<aui:fieldset>
<aui:field-wrapper label="start-date">
</aui:field-wrapper></aui:fieldset>
<div class="field-row">
<liferay-ui:input-date dayparam="schedulerStartDateDay" dayvalue="<%=startDateValue %>" disabled="<%= false %>" monthparam="schedulerStartDateMonth" monthvalue="<%=startMonthValue%>" name="startDate" yearparam="schedulerStartDateYear" yearvalue="<%=startYearValue%>">
</liferay-ui:input-date></div>
Here is the ouput
Following are the imports
<%@page import="com.liferay.portal.kernel.util.DateUtil"%>
<%@page import="com.liferay.portal.kernel.util.CalendarFactoryUtil"%>
<%@page import="java.util.Calendar"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
Please the code is wrong, missing characters etc. :-/
ReplyDeleteCan try once again , let me know which code snippets your getting wrong ...
ReplyDeleteWhere is the code??????
ReplyDeleteI have updated, please check now.
Delete