Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Esa Hekmat
using Joda-time instead of JDK Calendar
November 17, 2012 2:40 AM
Answer

Esa Hekmat

Rank: New Member

Posts: 13

Join Date: March 13, 2012

Recent Posts

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?
Hitoshi Ozawa
RE: using Joda-time instead of JDK Calendar
November 17, 2012 2:54 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

It's not that's simple. You'll also have to modify AlloyUI's calendar to change the popup calendar.
Esa Hekmat
RE: using Joda-time instead of JDK Calendar
November 19, 2012 9:40 AM
Answer

Esa Hekmat

Rank: New Member

Posts: 13

Join Date: March 13, 2012

Recent Posts

it seems you'r right. yes I should change AlloyUI Component too, but I didn't get my answer
Hitoshi Ozawa
RE: using Joda-time instead of JDK Calendar
November 19, 2012 3:16 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

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.
Banafshe Bamdad
RE: using Joda-time instead of JDK Calendar
April 21, 2014 11:09 PM
Answer

Banafshe Bamdad

Rank: Junior Member

Posts: 56

Join Date: November 6, 2007

Recent Posts

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
Esa Hekmat
RE: using Joda-time instead of JDK Calendar
April 22, 2014 12:39 AM
Answer

Esa Hekmat

Rank: New Member

Posts: 13

Join Date: March 13, 2012

Recent Posts

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.
sako izadpanahj
RE: using Joda-time instead of JDK Calendar
January 21, 2015 1:09 PM
Answer

sako izadpanahj

Rank: New Member

Posts: 1

Join Date: December 22, 2014

Recent Posts

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 ?
Banafshe Bamdad
RE: using Joda-time instead of JDK Calendar
January 22, 2015 5:12 AM
Answer

Banafshe Bamdad

Rank: Junior Member

Posts: 56

Join Date: November 6, 2007

Recent Posts

Salam,
Which type of calendar do you have? Ancient Liferay's Calendar portlet (with java code) or AlloyUI scheduler (with JavaScript code)?