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: 7

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: 8000

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: 7

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: 8000

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.