Forums / Basic Configuration / Date format problem in Specials in Admin

Date format problem in Specials in Admin

Views: 1,667

Results 1 to 14 of 14
8 Oct 2011, 7:07 AM
#1
markflickr avatar

markflickr

New Zenner

Join Date:
Dec 2010
Posts:
7
Plugin Contributions:
0

Date format problem in Specials in Admin

V1.39
I have three products in the specials area, one has an expiry date of 2036 despite setting it to 2011 one is in US format and one is okay.
What would cause this anomaly?

8 Oct 2011, 1:46 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Date format problem in Specials in Admin

If you edit the Special, what date do you see?

If you set the date with the Calendar, what date do you see?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Oct 2011, 3:24 PM
#3
markflickr avatar

markflickr

New Zenner

Join Date:
Dec 2010
Posts:
7
Plugin Contributions:
0

Re: Date format problem in Specials in Admin

Thanks for your response,
To pick the first one in the list (of 3)
in specials.php it says available 10/06/2011 and expires 10/11/2011
the original dates entered were 6th oct to 11th oct.
If i go to the edit page, the dates say 10th june to 10th nov, if i click on the calendar, it confirms that, so i change it to what i want it to be, all looks ok, i save it and we're back to square one...
2nd product says available 10/10/2011 and expires 30/11/2036, i changed the year back to 2011 but it keeps defaulting to 2036.
the third product is fine, dates all display exactly as i entered them.
To summarise, the calendar function agrees with the displayed date but both are not what i set or changed them to....

8 Oct 2011, 3:38 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Date format problem in Specials in Admin

In your language file for the admin:
/admin/includes/languages/english.php

what do you have in the defines that reference the date? :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Oct 2011, 6:33 PM
#5
markflickr avatar

markflickr

New Zenner

Join Date:
Dec 2010
Posts:
7
Plugin Contributions:
0

Re: Date format problem in Specials in Admin

like this:

<?php /** * @package admin * @copyright Copyright 2003-2010 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: english.php 15621 2010-03-06 10:01:29Z drbyte $ */ 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.. // on RedHat6.0 I used 'en_US' // on FreeBSD 4.0 I use 'en_US.ISO_8859-1' // this may not work under win32 environments.. setlocale(LC_TIME, 'en_US.ISO_8859-1'); 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 //// // 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, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4); } else { return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2); } }
8 Oct 2011, 6:51 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Date format problem in Specials in Admin

What dates are you physically typing?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Oct 2011, 7:09 PM
#7
markflickr avatar

markflickr

New Zenner

Join Date:
Dec 2010
Posts:
7
Plugin Contributions:
0

Re: Date format problem in Specials in Admin

I've tried typing dd/10/2011 and i've tried using the calendar for october dates, neither have made any difference.

8 Oct 2011, 7:28 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Date format problem in Specials in Admin

On the expiry date ... type in:
10/31/2011

save it and then edit ... what do you see?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Oct 2011, 8:03 PM
#9
markflickr avatar

markflickr

New Zenner

Join Date:
Dec 2010
Posts:
7
Plugin Contributions:
0

Re: Date format problem in Specials in Admin

If i do that it says 31/10/2011 or when i edit 31/10/2011, unless i choose a date from the calendar, then it defaults back to 2036

8 Oct 2011, 8:05 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Date format problem in Specials in Admin

Could you please type in exactly
10/31/2011

and save it and then edit it?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Oct 2011, 8:10 PM
#11
markflickr avatar

markflickr

New Zenner

Join Date:
Dec 2010
Posts:
7
Plugin Contributions:
0

Re: Date format problem in Specials in Admin

If i type it in exactly, it is right, if i use the calendar, it is incorrect.

8 Oct 2011, 8:20 PM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Date format problem in Specials in Admin

Change the define on spiffy to:

define('DATE_FORMAT_SPIFFYCAL', 'MM/dd/yyyy');  //Use only 'dd', 'MM' and 'yyyy' here in any order

Does the calendar work now?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Oct 2011, 7:23 AM
#13
markflickr avatar

markflickr

New Zenner

Join Date:
Dec 2010
Posts:
7
Plugin Contributions:
0

Re: Date format problem in Specials in Admin

Excellent, that fixed it, the calendar displays in UK date format, when you select the date, it posts into the available date and expiry date boxes in U.S format but when you save and go back to the summary page, it is in UK format and correct.
A weird anomaly but i can cope with that.
Thank you very much

9 Oct 2011, 1:13 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Date format problem in Specials in Admin

Thanks for the update that this is working for you now ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!