Shorten Months Displayed (e.g., November to Nov)
Is there a way I can shorten the months displayed in the theme? Without modifying the core vanilla files? I assume this can be done in the definitions file in locales\skeleton\definitions.php or locales\skeleton\other_definitions.php
Maybe even conf/locale.php
For example
November 15 to Nov 15
Something like this? But with out modifying the core files.
Oliver_Chevet's post at http://vanillaforums.org/discussion/11275/dates-localization/p1
Step 1 : create arrays for month and day names in the standard locale
In Garden/applications/dashboard/locale/en-CA/definitions.php look for :
$Definition['Date.DefaultDateTimeFormat'] = '%B %e, %Y %l:%M%p';
$Definition['Date.MonthNames'] = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
$Definition['Date.MonthShortNames'] = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
Step 2 : Modify Date_format to use those arrays
Modify library/core/class.format.php to use those arrays
Thanks again
Comments
It's only a translation task.
Set this in your /conf/locale.php:
$Definition['Date.DefaultDateTimeFormat'] = '%b %e, %Y %l:%M%p';
See http://php.net/manual/en/function.strftime.php if you are interested in what is happening here
Thanks for the response @R_J . It doesn't seem to work. I also changed p to P to test, and still no changes.
Should I delete the .ini files in cache?
Added these and now it works
$Definition['Date.DefaultFormat'] = '%b %e, %Y';
$Definition['Date.DefaultDayFormat'] = '%b %e';
$Definition['Date.DefaultYearFormat'] = '%b %Y';
try these ones in conf/locale.php and modify it to your own needs