Fórumok

how to change liferay datepicker to persian datepicker ?

emad darvishi, módosítva 8 év-val korábban

how to change liferay datepicker to persian datepicker ?

Junior Member Bejegyzések: 37 Csatlakozás dátuma: 2012.09.11. Legújabb bejegyzések
hi my friends .

im gonna to change liferay date picker to jquery persian date picker.
for this , im created a hook for override (for example) scheduler.jsp from html/portlet/journal/article/schedule.jsp .
and edited to :


<%--
/**
 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
--%>

<%@ include file="/html/portlet/journal/init.jsp"%>

<script type="text/javascript" src="/additionalfiles/jquery.js"></script>
<link href="/additionalfiles/persian-datepicker-0.3.6.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/additionalfiles/persian-date.js"></script>
<script type="text/javascript" src="/additionalfiles/persian-datepicker-0.3.6.min.js"></script>

&lt;%
	JournalArticle article = (JournalArticle) request
			.getAttribute(WebKeys.JOURNAL_ARTICLE);

	boolean neverExpire = ParamUtil.getBoolean(request, "neverExpire",
			true);

	if (article != null) {
		if ((article.getExpirationDate() != null)
				&amp;&amp; !article.isExpired()) {
			neverExpire = false;
		}
	}

	boolean neverReview = ParamUtil.getBoolean(request, "neverReview",
			true);

	if (article != null) {
		if (article.getReviewDate() != null) {
			neverReview = false;
		}
	}
%&gt;

<liferay-ui:error-marker key="errorSection" value="schedule" />

<aui:model-context bean="<%=article%>" model="<%=JournalArticle.class%>" />

<h3>
	<liferay-ui:message key="schedule" />
</h3>

<liferay-ui:error exception="<%=ArticleDisplayDateException.class%>" message="please-enter-a-valid-display-date" />
<liferay-ui:error exception="<%=ArticleExpirationDateException.class%>" message="please-enter-a-valid-expiration-date" />

<script type="text/javascript">
	$(document).ready(function() {
		$(".datepicker").persianDatepicker({
			format : "MM/DD/YYYY",
			dayPicker : {
				enabled : true
			},
			monthPicker : {
				enabled : true
			},
			yearPicker : {
				enabled : true
			},
			persianDigit : true,
		});
	});
</script>

<aui:fieldset>
	Display Date : <input name="displayDate" class="datepicker">
    <br>
	Expiration Date : <input name="expirationDate" class="datepicker">
    <br>
	Review Date : <input name="reviewDate" class="datepicker">
</aui:fieldset>


after deploy and click on publish content , show below error :


19:16:53,157 ERROR [http-bio-8080-exec-240][render_portlet_jsp:132] null
com.liferay.portlet.journal.ArticleDisplayDateException
	at com.liferay.portal.util.PortalImpl.getDate(PortalImpl.java:1830)
	at com.liferay.portal.util.PortalUtil.getDate(PortalUtil.java:495)
	at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.updateArticle(JournalArticleLocalServiceImpl.java:4726)
	at com.liferay.portlet.journal.service.JournalArticleLocalServiceWrapper.updateArticle(JournalArticleLocalServiceWrapper.java:3248)
	at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)



how to bind this input texts ?