Forums / General Questions / fix the advanced search date from field

fix the advanced search date from field

Locked

Views: 1,919

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
9 Feb 2008, 8:50 PM
#1
importprijs_nl avatar

importprijs_nl

New Zenner

Join Date:
Jan 2007
Location:
The Netherlands
Posts:
36
Plugin Contributions:
0

fix the advanced search date from field

After changing the date format to dd/mm/YY the advanced search 'Date from' and 'Date to' fields does't work anymore.

Any help very much appreciated.

Check it on my sites here:
http://www.goodwear.nl/index.php?main_page=advanced_search

and here on multilanguage site:
http://81.26.209.93/~itsthat/index.php?main_page=advanced_search

When changing language to English it works so it have to do with the changes in dutch.php inside languages directory.

21 Oct 2009, 2:04 PM
#2
jolla avatar

jolla

New Zenner

Join Date:
Mar 2009
Posts:
18
Plugin Contributions:
0

Re: fix the advanced search date from field

I have also noted this issue. Have you been able to find a fix this? any other users have a suggestion?

21 Oct 2009, 2:12 PM
#3
importprijs_nl avatar

importprijs_nl

New Zenner

Join Date:
Jan 2007
Location:
The Netherlands
Posts:
36
Plugin Contributions:
0

Re: fix the advanced search date from field

jolla:

I have also noted this issue. Have you been able to find a fix this? any other users have a suggestion?

Yes but i have fixed it in februar 2008.. so i don't remeber exactly how i did it. I think it had to do with my Dutch translationfiles and i fixed it and uploaded the new translation to zen-cart.nl (on the forum). My name on the Dutch forum is Zenned.nl

Kind regards,

Bjarne

21 Oct 2009, 2:51 PM
#4
jolla avatar

jolla

New Zenner

Join Date:
Mar 2009
Posts:
18
Plugin Contributions:
0

Re: fix the advanced search date from field

ok. I'm using the italian version. I would love to keep the dd/mm/yyyy format. As of now that doesnt work. The search has to be done using the US mm/dd/yyyy format. Which format are you currently using?

22 Oct 2009, 10:37 AM
#5
importprijs_nl avatar

importprijs_nl

New Zenner

Join Date:
Jan 2007
Location:
The Netherlands
Posts:
36
Plugin Contributions:
0

Re: fix the advanced search date from field

jolla:

ok. I'm using the italian version. I would love to keep the dd/mm/yyyy format. As of now that doesnt work. The search has to be done using the US mm/dd/yyyy format. Which format are you currently using?

Ok i thought you are Dutch, sorry my mistake.
Please look in italian.php in /includes/languages/italian(?).php

There must be some part like this:

// look in your $PATH_LOCALE/locale directory for available locales..
// on RedHat try 'en_US'
// on FreeBSD try 'en_US.ISO_8859-1'
// on Windows try 'en', or 'English'
  @setlocale(LC_TIME, 'en_US.ISO_8859-1');
  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('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

////
// Return date in raw format
// $date should be in format mm/dd/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
  if (!function_exists('zen_date_raw')) {
    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);
      }
    }
  }

Change that to (after you make backup!!):

  @setlocale(LC_TIME, 'it_IT.ISO_8859-1');
  define('DATE_FORMAT_SHORT', '%d/%m/%Y');  
  define('DATE_FORMAT_LONG', '%A %d %B, %Y'); 
  define('DATE_FORMAT', 'd/m/Y');
  define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

////

  if (!function_exists('zen_date_raw')) {
    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);
      }
    }
  }