Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Birthdate displaying incorrectly


Guest

Recommended Posts

Greetings:

 

I've recently installed the latest version of osCommerce - great product, by the way - but I have an issue with the way the birthdate in my test account is being displayed. I entered 02/24/1969 but 12/31/1969 is showing in the dob field on the account_edit.php page. The data is correct in the database but does not display as such. Suggestions are appreciated.

 

Thanks for taking a moment to read this post!

Link to comment
Share on other sites

I checked all of the date instances in the specified file but do not see that anything is out of order. I even changed the locale syntax, all to no avail. I may be missing something. No? Below is a snip of the variables that I was looking at:

@setlocale(LC_TIME, 'en_US');

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
function tep_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);
 }
}

Link to comment
Share on other sites

Now it shows up as 31/12/1969. This only moves the incorrect numbers around. The form element is being populated by the function tep_date_short in the general.php function definitions. If I delete the function call and just have it pull $account['customers_dob'] straightaway, I end up 1969-02-24 00:00:00 in the field. The proper data, but not a pretty format. I doubt that the tep_date_short function is faulty. Is there another config variable that I could be missing?

Link to comment
Share on other sites

I've done that. The dob is correct in the database - it's just getting mangled on the way to the form element population.

Link to comment
Share on other sites

Are we discussing the catalog part or the admin? For the admin you have to repeat the previous steps in catalog/admin/includes/languages/yourlanguage.php

Link to comment
Share on other sites

I edited both files. Following the example of the post that you suggested only changes slashes to dots. I still get the erroneous output. The site is hosted on godaddy. Would this have any relevance? All other date output on the site seems to be fine. It's just this field.

Link to comment
Share on other sites

Maybe it worths to have a look at the german.php files in the catalog and the admin since they have the correct date setup. Here one more link you could check out. I don't think the problem is caused due to your provider.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...