Main menu

Forum


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

  • Qasemian
  • Autore della discussione
  • New Member
  • New Member
Di più
4 Anni 6 Mesi fa #17003 da 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.

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • Lyr!C
  • Avatar di Lyr!C
  • Administrator
  • Administrator
  • Lead Developer
Di più
4 Anni 5 Mesi fa #17023 da Lyr!C
Hello,

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

Best regards,
Cyril

Latest version : iCagenda 3.9.7
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 allegato:

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • Qasemian
  • Autore della discussione
  • New Member
  • New Member
Di più
2 Anni 3 Mesi fa #17855 da 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 allegato:

Nome del file: jdf.zip
Dimensione del file:5 KB
Allegati:

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • Lyr!C
  • Avatar di Lyr!C
  • Administrator
  • Administrator
  • Lead Developer
Di più
2 Anni 3 Mesi fa #17861 da 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.7
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 allegato:

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • betinajessen
  • New Member
  • New Member
Di più
2 Anni 1 Mese fa #17954 da 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.

Si prega Accedi o Crea un account a partecipare alla conversazione.

Tempo creazione pagina: 0.175 secondi

 

Follow Us

Create your Joomla templates with Template Creator CK

acymailing logo new