hi dears, any one works with jalali date? how to create it in elgg?

hi dears, any one works with jalali date? how to create it in elgg?

how to change date  to jalali date?

  • I don't even know what the Jalali date exactly is. It seems an alternative calendar. I don't know if it's possible to easily replace the Gregorian calendar based date handling with Jalali though as I don't know about the exact rules (one problem might be that there's no fixed date for beginning of the year).

    There might be some jquery plugin available that provides Jalali support. You would have to implement a plugin replacing the usage of the normal jquery datepicker with such an alternative datepicker. Most likely some code is also necessary to correctly save the input and then also to output the date in Jalali correctly.

    I guess if you can't do that on your own you would need to hire a developer who does the job for you (preferrably a developer who knows about the specifics of the Jalali calendar).

  • Sadra Borzouei

    hi dear @iionly ,

    thanks for your reply.

    please see this link ( https://en.wikipedia.org/wiki/Jalali_calendar )

    i want replace Jalali date to Gregorian calendar  in my  own websites . thanks for your help.

    regards sadra

  • Sorry. But I won't have any time to help you with this (most likely I can't even help you simply because I would have trouble with reading any documentation in Persian or with testing).

    I can only suggest what might be necessary for Jalali support. It would be necessary to modify the calendar ("datepicker") for input of dates to use a datepicker jquery plugin that supports Jalali. In Elgg the input/date view (vendor/elgg/elgg/views/default/input/date.php) provides the date input fields and the JS code corresponding to it is in vendor/elgg/elgg/views/default/input/date.js. It would be necessary to replace/override these files with a custom version that adds the Jalali support (with a jquery datepicker like https://github.com/behzadi/persianDatepicker also added in the plugin).

    Internally, the dates would still be saved/handled as unix timestamps by Elgg (assuming that the jquery Jalali datepicker would save the date values accordingly). Then the output of dates from the unix timestamp format into a Jalali date would have to be made by converting the dates accordingly. The plugin https://elgg.org/plugins/869364 does also some formatting of dates on output already (still Gregorian calendar) and you could use this plugin as starting point, i.e. the conversion into Jalali dates would have to be implemented (most likely some existing php library or class can be used for that).

    That's just the minimum work necessary though. For example the Event Calendar plugin handles all input and output of calendars and dates on its own. Most likely other calendar plugins of Elgg won't be much different and would also require (a lot of?) modifications.

    As I said, I can't do all this work for you. If you can't code it on your own, you would have to hire a developer to do the ob for you.

  • Sadra Borzouei

    hi dear @iionly

    thanks very much for your kidness dear friend. i do it.