Inserting Farsi date

Discuss setup / installation issues - Add a spell checker, Language pack?
Post Reply
momeni
Posts: 5
Joined: Sat Jan 24, 2009 1:54 pm

Inserting Farsi date

Post by momeni »

Hi everyone,
There is a problem in date insertion for Farsi language (Farsi Date format). The gedit date insertion works well, but openoffice do the conversion incorrectly. It seems that openoffice doesn't use the system date. How can I solve this problem?
OOo 2.4.X on Fedora 8 + win XP
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: inserting Farsi date

Post by Villeroy »

What exactly do you do?
What is it what you get?
What is it what you want to see?
What has gedit to do with it?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
momeni
Posts: 5
Joined: Sat Jan 24, 2009 1:54 pm

Re: inserting Farsi date

Post by momeni »

When I insert a date property in a document, while my locale is Farsi, it should display 5 Bahman 1387, but it displays 24 Farvardin 2009. There are several problems here: 24 Farvardin is the system date when using UTC, even using UTC, the year is not 2009 (seems year is not converted from Gregorian to Farsi). I don't want using UTC for Farsi date. Just for a comparison, I tested Gedit. Gedit displays the date correctly. It seems that gedit is getting date from system, which is right, but openoffice doesn't do that.
OOo 2.4.X on Fedora 8 + win XP
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: inserting Farsi date

Post by Villeroy »

OK, it's clear now. I have to study the Farsi calendar. Is there some formula to convert one date into the other? It would be easy if there would be a fixed amount of days, so Gregorian minus X days gives the correct Farsi date?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
momeni
Posts: 5
Joined: Sat Jan 24, 2009 1:54 pm

Re: inserting Farsi date

Post by momeni »

There is the exact conversion functions available in LGPL: http://www.farsiweb.info/jalali/jalali.c,
OOo 2.4.X on Fedora 8 + win XP
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: inserting Farsi date

Post by acknak »

Ok, I see now what you're after: OOo is simply translating the day and month names. You're looking for it to convert a Gregorian date into the equivalent date in the Islamic calendar.

There is some support in OOo for calendar conversions; under the online help (index: "date formats"), I see this:
...
[~hijri] Arabic Islamic Calendar, currently supported for the following locales: ar_EG, ar_LB, ar_SA, and ar_TN
...

That doesn't sound like it's going to help much. You may need to do the conversion by your own formula.
AOO4/LO5 • Linux • Fedora 23
momeni
Posts: 5
Joined: Sat Jan 24, 2009 1:54 pm

Re: inserting Farsi date

Post by momeni »

NO, it's not islamic calendar, it's Farsi calender (sometimes called Jalali), the strings (month names) are tranlated. there is just a problem in date conversion. It's partially converted using UTC. The first problem is that it shouldn't use UTC. The second problem is that even using UTC, it doesn't convert year field. the output for year is 2009, it should be 1387.
OOo 2.4.X on Fedora 8 + win XP
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: inserting Farsi date

Post by acknak »

NO, it's not islamic calendar, it's Farsi calender...
Sorry, I assumed they are the same. I beg your pardon.
AOO4/LO5 • Linux • Fedora 23
User avatar
Robert Tucker
Volunteer
Posts: 1250
Joined: Mon Oct 08, 2007 1:34 am
Location: Manchester UK

Re: inserting Farsi date

Post by Robert Tucker »

Perhaps take your issue to:

http://fa.openoffice.org/
LibreOffice 7.x.x on Arch and Fedora.
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: inserting Farsi date

Post by Villeroy »

If we are talking about http://en.wikipedia.org/wiki/Iranian_calendar then it should be a matter of course to support the correct dates because this calendar is almost the same as the western one. It is based on the solar year with 6 months of 31 days, followed by 5 months of 30 and the last month having 29 days or 30 in leap years. The result is a year of 365 or 366 days.
Things become really difficult with the moon based system of Arabian countries.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Robert Tucker
Volunteer
Posts: 1250
Joined: Mon Oct 08, 2007 1:34 am
Location: Manchester UK

Re: inserting Farsi date

Post by Robert Tucker »

This website may be of interest:

http://www.alavi.us/jcal/
LibreOffice 7.x.x on Arch and Fedora.
momeni
Posts: 5
Joined: Sat Jan 24, 2009 1:54 pm

Re: inserting Farsi date

Post by momeni »

Yes, I mean Iranian calendar. Open office supports this calender, but there are problems. The conversion is not right.
OOo 2.4.X on Fedora 8 + win XP
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: inserting Farsi date

Post by Villeroy »

momeni wrote:Yes, I mean Iranian calendar. Open office supports this calender, but there are problems. The conversion is not right.
Yes, and http://fa.openoffice.org/ is the project which is responsible for the Farsi localization of OpenOffice.org.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply