Main menu

Forum


Date not correctly show in Jalali calendar in (persian or farsi) language

  • Qasemian
  • Topic Author
  • New Member
  • New Member
More
3 years 10 months ago #17003 by Qasemian
Hi
I instal icagenda in joomla with jalali calendar, every thing is ok but date in calendar module not show correctly! for example: May 12, 1980 is monday but in jalali calendar (Ordibehesht 22, 1359) show in Wednesday!
How can I solve this problem?
Thank you.

Please Log in or Create an account to join the conversation.

 

  • Lyr!C
  • Lyr!C's Avatar
  • Administrator
  • Administrator
  • Lead Developer
More
3 years 10 months ago #17023 by Lyr!C
Hello,

Is it possible to have an online link to the page?

Best regards,
Cyril

Latest version : iCagenda 3.9.2
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File Attachment:

Please Log in or Create an account to join the conversation.

  • Qasemian
  • Topic Author
  • New Member
  • New Member
More
1 year 8 months ago #17855 by Qasemian
Hello again
Unfortunately, this problem has not been fixed in the new updates!
The Jalali calendar is widely used in the Middle East region, but the "calendar display module" does not support it and displays dates based on the Gregorian calendar!
To check this issue, you need to add the Persian language to Joomla and set it as the default language, then display the calendar module in this language.
I have attached the official and verified PHP code file for converting the Gregorian calendar to Jalali.
But I don't know how to add this code to the source of calendar display module to solve this problem!
I request you, if it is possible, add this code in the source of the icagenda calendar in new updates, so that whenever the Persian language is selected, this calendar will be executed automatically.
Thank you 

File Attachment:

File Name: jdf.zip
File Size:5 KB
Attachments:

Please Log in or Create an account to join the conversation.

  • Lyr!C
  • Lyr!C's Avatar
  • Administrator
  • Administrator
  • Lead Developer
More
1 year 7 months ago #17861 by Lyr!C
Hello,

You didn't provided an online link, which could have help me ;-)

Note: Joomla includes already a Jalali php script which is supposed already to be used by iCagenda (it was working by the past, and i've not changed this part since a long time, so i wonder why it does not work anymore...)

Best regards,
Cyril

Latest version : iCagenda 3.9.2
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File Attachment:

Please Log in or Create an account to join the conversation.

  • betinajessen
  • New Member
  • New Member
More
1 year 5 months ago #17954 by betinajessen
For parsing the date string, I simply use the default calendar to get the date values (year, month, day, etc.)I then use  this library here  to convert the Persian date values to the Gregorian date values.My code now looks like this:
string persianDate = "1390/02/07";
CultureInfo persianCulture = new CultureInfo("fa-IR");
DateTime persianDateTime = DateTime.ParseExact(persianDate, "yyyy/MM/dd", persianCulture);    // this parses the date as if it were Gregorian

JalaliCalendar jc = new JalaliCalendar();
// convert the Persian calendar date to Gregorian
DateTime gregorianDateTime = jc.ToDateTime(persianDateTime.Year, persianDateTime.Month, persianDateTime.Day, persianDateTime.Hour, persianDateTime.Minute, persianDateTime.Second, persianDateTime.Millisecond);
Of course, I'll have to take care of date components with names (months, days of the week) myself, but I can deal with that pretty easily.

Please Log in or Create an account to join the conversation.

Time to create page: 0.165 seconds

 

Follow Us

acymailing logo new

Create your Joomla templates with Template Creator CK