Hi All,
just starting to build a new site using 1.5.5a and am having difficulty changing the date format to the UK style on the site in general and on the admin pages, any advice welcome.
It seemed to work Ok on 1.5.4......
Michael
Hi All,
just starting to build a new site using 1.5.5a and am having difficulty changing the date format to the UK style on the site in general and on the admin pages, any advice welcome.
It seemed to work Ok on 1.5.4......
Michael
You can change them in both your english.php files (one in admin, and one in shop side).
Around line #20 you should see somthing like this
PHP Code:
// look in your $PATH_LOCALE/locale directory for available locales..
$locales = array('en_US', 'en_US.utf8', 'en', 'English_United States.1252');
@setlocale(LC_TIME, $locales);
define('DATE_FORMAT_SHORT', '%m/%d/%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
define('PHP_DATE_TIME_FORMAT', 'm/d/Y H:i:s'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
define('DATE_FORMAT_SPIFFYCAL', 'MM/dd/yyyy'); //Use only 'dd', 'MM' and 'yyyy' here in any order
define('ADMIN_NAV_DATE_TIME_FORMAT', '%A %d %b %Y %X'); // this is used for strftime()
Zen cart installation / maintenance / customisation / hosting
Supported Modules: Dutch language pack, Multi site, Dynamic Price Updater and more.
Thanks, just found my mistake in not changing one of the lines of code Doh !
Michael
Hi Guys,
Can someone advise what may be wrong with the changes below for UK date format. The changes break the admin totally. Version 1.5.5f
Thanks,
George
<?php
/**
* @package admin
* @copyright Copyright 2003-2016 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: Author: DrByte Wed Mar 23 14:21:26 2016 -0500 Modified in v1.5.5 $
*/
if (!defined('IS_ADMIN_FLAG'))
{
die('Illegal Access');
}
// added defines for header alt and text
define('HEADER_ALT_TEXT', 'Admin Powered by Zen Cart :: The Art of E-Commerce');
define('HEADER_LOGO_WIDTH', '200px');
define('HEADER_LOGO_HEIGHT', '70px');
define('HEADER_LOGO_IMAGE', 'logo.gif');
// look in your $PATH_LOCALE/locale directory for available locales..
$locales = array('en_GB', 'en_GB.utf8', 'en', ‘English_United Kingdom.1252’);
@setlocale(LC_TIME, $locales);
define('DATE_FORMAT_SHORT', ‘%d/%m/%Y’); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', ‘d/m/Y’); // this is used for date()
define('PHP_DATE_TIME_FORMAT', ‘d/m/Y H:i:s'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
define('DATE_FORMAT_SPIFFYCAL', ‘dd/MM/yyyy'); //Use only 'dd', 'MM' and 'yyyy' here in any order
define('ADMIN_NAV_DATE_TIME_FORMAT', '%A %d %b %Y %X'); // this is used for strftime()
////
// Return date in raw format
// $date should be in format dd/mm/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
function zen_date_raw($date, $reverse = false) {
if ($reverse) {
return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
} else {
return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
}
}
Maybe I'm slow today or its not obvious, but the FAQ to accomplish this is: https://www.zen-cart.com/content.php...-to-dd-mm-yyyy
If that doesn't work for you, then perhaps can explain where things go/went wrong.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
@Georgecy, you've apparently edited that file using WordPress or some other non-ASCII editor. The issue is that you've got left- and right-single-quotes instead of just plain-old quotes in those definitions.
You'll need to change the highlighted characters in your original file
Code:
// look in your $PATH_LOCALE/locale directory for available locales..
$locales = array('en_GB', 'en_GB.utf8', 'en', ‘English_United Kingdom.1252’);
@setlocale(LC_TIME, $locales);
define('DATE_FORMAT_SHORT', ‘%d/%m/%Y’); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', ‘d/m/Y’); // this is used for date()
define('PHP_DATE_TIME_FORMAT', ‘d/m/Y H:i:s'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
define('DATE_FORMAT_SPIFFYCAL', ‘dd/MM/yyyy'); //Use only 'dd', 'MM' and 'yyyy' here in any order
define('ADMIN_NAV_DATE_TIME_FORMAT', '%A %d %b %Y %X'); // this is used for strftime()
to
Code:
// look in your $PATH_LOCALE/locale directory for available locales..
$locales = array('en_GB', 'en_GB.utf8', 'en', 'English_United Kingdom.1252');
@setlocale(LC_TIME, $locales);
define('DATE_FORMAT_SHORT', '%d/%m/%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'd/m/Y'); // this is used for date()
define('PHP_DATE_TIME_FORMAT', 'd/m/Y H:i:s'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
define('DATE_FORMAT_SPIFFYCAL', 'dd/MM/yyyy'); //Use only 'dd', 'MM' and 'yyyy' here in any order
define('ADMIN_NAV_DATE_TIME_FORMAT', '%A %d %b %Y %X'); // this is used for strftime()
@Georgecy, you've apparently edited that file using WordPress or some other non-ASCII editor. The issue is that you've got left- and right-single-quotes instead of just plain-old quotes in those definitions.
You'll need to change the highlighted characters in your original file
toCode:// look in your $PATH_LOCALE/locale directory for available locales.. $locales = array('en_GB', 'en_GB.utf8', 'en', ‘English_United Kingdom.1252’); @setlocale(LC_TIME, $locales); define('DATE_FORMAT_SHORT', ‘%d/%m/%Y’); // this is used for strftime() define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime() define('DATE_FORMAT', ‘d/m/Y’); // this is used for date() define('PHP_DATE_TIME_FORMAT', ‘d/m/Y H:i:s'); // this is used for date() define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S'); define('DATE_FORMAT_SPIFFYCAL', ‘dd/MM/yyyy'); //Use only 'dd', 'MM' and 'yyyy' here in any order define('ADMIN_NAV_DATE_TIME_FORMAT', '%A %d %b %Y %X'); // this is used for strftime()
Code:// look in your $PATH_LOCALE/locale directory for available locales.. $locales = array('en_GB', 'en_GB.utf8', 'en', 'English_United Kingdom.1252'); @setlocale(LC_TIME, $locales); define('DATE_FORMAT_SHORT', '%d/%m/%Y'); // this is used for strftime() define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime() define('DATE_FORMAT', 'd/m/Y'); // this is used for date() define('PHP_DATE_TIME_FORMAT', 'd/m/Y H:i:s'); // this is used for date() define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S'); define('DATE_FORMAT_SPIFFYCAL', 'dd/MM/yyyy'); //Use only 'dd', 'MM' and 'yyyy' here in any order define('ADMIN_NAV_DATE_TIME_FORMAT', '%A %d %b %Y %X'); // this is used for strftime()
Zen Cart 156b vanilla allows DOB to be entered 05/21/1970 or 21-05-1970.
https://github.com/zencart/zencart/c...02f506c1f877f4
How does that sit with the changes detailed here/in the FAQ...which does require updating to utf-8 anyway:
https://www.zen-cart.com/content.php...-to-dd-mm-yyyy
Steve
github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...
The default (pre-change to "UK" format) recommendation is: MM/DD/YYYY or YYYY-MM-DD. The first is sleuthed out by evaluation of the zen_date_raw function results which should smoothly transition when changes are made per the above guidance. The second format is how javascript presents dates regardless of locale. The use of dashes is for an example as actually, the date could be entered in the sequence of the second example with dashes (-), forward slashes (/), or all compressed together with no separation.
This modification is the same as was made previously for create_account, although this time the help text was updated to notify the customer of the options since a date picker is not necessarily forced on the user and not all such date pickers will leave the content in the format of the locale.
So if create_account went well in Zen Cart 1.5.6 or 1.5.6a, then this additional change for account_edit will perform the same.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
All that said, looking at the guidance provided from the perspective following along word-for-word there certainly is a discrepancy. Perhaps the instructions could be slightly relaxed in the area describing what to change associated with the language defines to search for the date as specifically provided and to be replaced with the date in the desired format. This is instead of searching for the entire line and replacing with the entire line.
Yes an alternative would be to undo the text modification, though that seems to me to be a step in the wrong direction. Otherwise, seems like some modification otherwise could be made to accomodate those that seek perfection.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Bookmarks