OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Date Format on entire system

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Date Format on entire system

Postby mcampos » Tue Jun 12, 2007 1:38 pm

I searched in the forum but didn't find answers. I need to alter date format to dd/mm/yyyy on entire system. I altered the config.inc.php on ojs root directory, but this don't work. I altered manually, in all files, the string 'Y-m-d' to 'd/m/Y', but this cause date to be wrote wrong in database. The date is written as 0000-00-00. I need specially to show date in format dd/mm/yyyy in emails templates. I used modifier date_format of smarty template and don't work. The date isn't displayed using date_format.

Somebody can help me?


Thank you.
Last edited by mcampos on Thu Jun 14, 2007 11:56 am, edited 1 time in total.
mcampos
 
Posts: 13
Joined: Thu Mar 15, 2007 1:53 pm
Location: Brazil

Postby asmecher » Tue Jun 12, 2007 2:58 pm

Hi Manoel,

You can change the date formats in the config.inc.php configuration file under the [general] section; most dates are formatted using the date_format_short format. See http://www.php.net/manual/en/function.strftime.php for a description of the format string.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Postby mcampos » Tue Jun 12, 2007 3:14 pm

I alter this section but don't work. The date is displayed as yyyy-mm-dd
mcampos
 
Posts: 13
Joined: Thu Mar 15, 2007 1:53 pm
Location: Brazil

Postby asmecher » Tue Jun 12, 2007 4:09 pm

Hi Manoel,

To change the way dates are formatted in emails, you need to change the code in a couple of places:
  • classes/submission/reviewer/ReviewerAction.inc.php approx. line 101:
    Code: Select all
    'reviewDueDate' => date('Y-m-d', strtotime($reviewAssignment->getDateDue()))
  • classes/submission/sectionEditor/SectionEditorAction.inc.php approx. line 215:
    Code: Select all
    $weekLaterDate = date('Y-m-d', strtotime('+1 week'));
    ...and line 218:
    Code: Select all
    $reviewDueDate = date('Y-m-d', strtotime($reviewAssignment->getDateDue()));
    ...and line 221:
    Code: Select all
    $reviewDueDate = date('Y-m-d', strtotime('+' . $numWeeks . ' week'));
    ...and line 394:
    Code: Select all
    'reviewDueDate' => date('Y-m-d', strtotime($reviewAssignment->getDateDue())),
  • classes/tasks/ReviewReminder.inc.php approx. line 62:
    Code: Select all
    'reviewDueDate' => date('Y-m-d', strtotime($reviewAssignment->getDateDue())),
If you're using subscription expiry reminders, you'll need to add date formatting to classes/tasks/SubscriptionExpiryReminder.inc.php as well.

For all of these functions, you need to use the format strings described at http://php.net/manual/en/function.date.php.

I'll make a note to have these formatted using the configuration variables so that you'll be able to easily customize the date display within emails in a subsequent release.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Postby asmecher » Tue Jun 19, 2007 11:47 am

Hi all,

There's a patch for this issue at http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=2914; the fix will be released with OJS 2.2.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Postby mcampos » Tue Jun 19, 2007 3:37 pm

Very good. Was about this that I was talking.
mcampos
 
Posts: 13
Joined: Thu Mar 15, 2007 1:53 pm
Location: Brazil


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests