Jalali plugin for OJS 3.1

Hi all,
I need to update Jalali Plugin for OJS 3.1 and it seems it is not done before.
I tried updating the previous version of this plugin which works on OJS 2.4.8 and made some changes; but my problem is in the register function. in the old version it was

$templateMgr->register_modifier('date_format', array(&$this, 'dateFormatJalali'));

I changed it to

HookRegistry::register('date_format', array($this, 'dateFormatJalali'));

But it still is not registered and the new date_format variable is not replaced.
Any help is appreciated.
Tnx

Hi again,
I modified and now it works on the home page and notifications.
But it does not affect the articles` ‘Activity log and Notes’ pages.
Any ideas?

Best,

Hi @alirezaaa,

Not all dates are formatted via the TemplateManager’s date_format modifier – some dates are presented directly, like the timestamps in the event log, and some use e.g. PHP’s date function. You’ll need to do some dev work on the plugin to ensure that all means of formatting dates are covered.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
Thank you for your response. this looks to be an impossible plugin!

maybe usefull:

Hi @Azerilatama,
I am also working on this topic and I tried to override the Date functions. however, this needs hardcoding of all date , time functions in OJS and can not be done via a plugin (which is really troubling).
DO NOT save Jalali dates in DB. All dates should be saved in Gregorian format and converted on display.

1 Like

hi @alirezaaa
could i ask,jalali plugin works finaly?
if it works,could i have it?

i hope u share it with me

Hi @mbabaei,
Unfortunately, a Jalali Date Plugin could not be developed easily because OJS3 does not use a single class for displaying dates (like TemplateManager in OJS2).
However, I am guessing that this will be done in future releases of OJS3. In that case, I will develop this plugin and share it here.

1 Like

Hi all,

I haven’t looked, but it’s entirely possible that there’s a good (small) library that supports several date formats. If so, I’d be open to proposals that refactor OJS to use consistent functions for all of its use cases.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

thanks @alirezaaa and @asmecher for ur attention to my topic

dear @asmecher, can i ask how can solve my problem i need Jalali Date Plugin , if its not work’s fine with OJS 3.1, the next version when publish ? or is there anyway to help me ??

Hi @mbabaei,

At the moment it’s not a high priority for us to implement Jalali support, but we’re open to revewing and merging code contributions. I would be happy to help steer this if someone has developer time to contribute.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like