Foros de discusión

using Joda-time instead of JDK Calendar

thumbnail
Esa Hekmat, modificado hace 11 años.

using Joda-time instead of JDK Calendar

New Member Mensajes: 13 Fecha de incorporación: 13/03/12 Mensajes recientes
using Liferay Localization is not enough to use localized calendar systems(Calendar systems like Japanese or Hijri(Persian)Calendar, not just translating Georgian calendar to other languages). so I decide to make liferay to use other Calendar systems(changing in Portal Source Code or using Ext Plugin). as Liferay use JDK Calendar standard and extending JDK default Calendar system to implement a new Calendar like Hijri is almost impossible, the new idea is changing liferay to use another Calendar liberaries like Joda-Time(which has a great power for localization).
I summarize my solution to use custom Calendar Systems:

changing the CalendarFactory Service API for changing method signature to use Joda-Time Classes instead of java.util.Calendar
implement new CalendarFactoryImpl
correcting all the side-effect Errors(couse they expect java.util.Calendar not org.joda.time.DateTime)

I have two Question.
1. am I correct in this path?
2.how can I use Ext Plugin to change the Core Service API, I mean changin the CalendarFactory/Util interfaces (change return types...)and manage other side-effects?
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: using Joda-time instead of JDK Calendar

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
It's not that's simple. You'll also have to modify AlloyUI's calendar to change the popup calendar.
thumbnail
Esa Hekmat, modificado hace 11 años.

RE: using Joda-time instead of JDK Calendar

New Member Mensajes: 13 Fecha de incorporación: 13/03/12 Mensajes recientes
it seems you'r right. yes I should change AlloyUI Component too, but I didn't get my answer
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: using Joda-time instead of JDK Calendar

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
You'll just want to change how calendar is presented to the user instead of how dates are kept in the system. That is, you'll want to wrap the liferay's calendar system instead of modifying it. Have your presentation layer call your wrapper methods instead of liferay.
thumbnail
Banafshe Bamdad, modificado hace 10 años.

RE: using Joda-time instead of JDK Calendar

Junior Member Mensajes: 71 Fecha de incorporación: 6/11/07 Mensajes recientes
Dear Mr. Hekmatizadeh,

I am using liferay6.2 and AlloyUI V.2. I need to have calendar portlet in Jalali date. I am a java programmer and a beginner in AlloyUI. I had changed calendar in previeus version of liferay to show jalali dates, It was simple because I just modified the JSP and Java files. I am completely confused about the new version of calendar portlet.

Any help about this issue would be greatly appreciated!
Banafshe
thumbnail
Esa Hekmat, modificado hace 10 años.

RE: using Joda-time instead of JDK Calendar

New Member Mensajes: 13 Fecha de incorporación: 13/03/12 Mensajes recientes
you are right in this version, the core code of Calendar portlet UI is not in JSP and java files. its a new alloy-UI element(http://alloyui.com/examples/scheduler/) which written in javascript. to localize these type of elements we should first localize alloy-ui components(standard way) or use another javascript elements like JQueryUI or KendoUI (it's not recommended).
as there isn't any localized component in Alloy-ui components for Jalali Calendar(no datepicker and no Scheduler) I change the main source code to use jQueryUI datepicker for Persian Language pages for my personal use. but I believe the correct way is contribute to localize alloy-ui elements first.
thumbnail
sako izadpanahj, modificado hace 9 años.

RE: using Joda-time instead of JDK Calendar

New Member Mensaje: 1 Fecha de incorporación: 22/12/14 Mensajes recientes
salam banafshe khanum man az liferay 6.1.2 estefade mikonam va badjoor tu in taqvime farsi gir kardam mishe begid daqian kojaharo bayad modify konam ?
thumbnail
Banafshe Bamdad, modificado hace 9 años.

RE: using Joda-time instead of JDK Calendar

Junior Member Mensajes: 71 Fecha de incorporación: 6/11/07 Mensajes recientes
Salam,
Which type of calendar do you have? Ancient Liferay's Calendar portlet (with java code) or AlloyUI scheduler (with JavaScript code)?