Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change the DOB Format from MM/DD/YYYY To DD/MM/YYYY


Guest

Recommended Posts

Change some bits in english.php to look like this to make it UK specific:

 

setlocale(LC_TIME, 'en_GB.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 strftime()

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, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);

} else {

return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);

}

}

 

// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)

define('LANGUAGE_CURRENCY', 'GBP');

 

// Global entries for the <html> tag

define('HTML_PARAMS','dir="LTR" lang="en"');

 

// charset for web pages and emails

define('CHARSET', 'iso-8859-1');

 

 

and

 

define('JS_DOB', '* The 'Date of Birth' entry must be in the format: xx/xx/xxxx (day/month/year).n');

 

define('ENTRY_DATE_OF_BIRTH_ERROR', ' <small><font color="#FF0000">(eg. 21/05/1970)</font></small>');

 

define('ENTRY_DATE_OF_BIRTH_TEXT', ' <small>(eg. 21/05/1970) <font color="#AABBDD">required</font></small>');

Ian-san

Flawlessnet

Link to comment
Share on other sites

Ian - I will do my best. I kind of thought there might be an easy way. But hey------ya gotta learn to code one day or another. So here goes (Hope you can hold my hand)

Ta. :shock:

Link to comment
Share on other sites

Yo Ian,

Parse error: parse error in /home/aussiehomeshop/web/catalog/includes/languages/english.php on line 183

What have I done?

 

Did you leave any spaces at the end of the file or leave off any ';'?

Ian-san

Flawlessnet

Link to comment
Share on other sites

  • 2 months later...

Hi!

 

In Sweden we got a personal/social security number..

 

Mine is 19700728-XXXX

1970 is the year, 07 is the month and 28 is the day.

XXXX are control numbers.

 

So I want to change from DD/MM/YYYY

to YYYYMMDD-XXXX

 

How??! Please..

 

 

Best Regards,

Patrick

Link to comment
Share on other sites

I want to change the format from 01/01/1970 to 700101xxxx.

xxxx is social number in sweden and the best confirmation way.

 

I tried to use your exemple but couldn't get it to work. Now I'm back on square one:-(

Could you maby help me?

 

Fred

Link to comment
Share on other sites

What a great piece of info. Thanks Ian and others. This worked great! :D  :D  :D  :D  :D  :D  :D  :)  :)  :)  :wink:  :wink:  :wink:

 

What about the parts that are hard coded and show you the format to type it in.. I have lookd just about everywhere and can not see how to change the (eg. 05/21/1970) re in the page titled my account information.

 

ANy one esle got any ideas please.

 

I think there might be other areas that require to be chaged but can't test those just yet!

 

thanks in advance

Link to comment
Share on other sites

All these format examples are in the main language file e.g. english.php

 

They are easy to find if you just run down the file - from memory, there are only 2 to change:

 

ENTRY_DATE_OF_BIRTH_ERROR

 

and

 

ENTRY_DATE_OF_BIRTH_TEXT

Ian-san

Flawlessnet

Link to comment
Share on other sites

All these format examples are in the main language file e.g. english.php

 

They are easy to find if you just run down the file - from memory, there are only 2 to change:

 

ENTRY_DATE_OF_BIRTH_ERROR

 

and

 

ENTRY_DATE_OF_BIRTH_TEXT

 

Thanks Ian.

 

I had done those changes but the uploaded file must have not overwritten the one already there. I cant test the login (due to CERT problems just now) so was not aware that the input would have been wrong anyway but I could see the text had not chnaged and it was not until I checked what you had written that I could see your changes adressed this already...Done properly! :D

Link to comment
Share on other sites

Hey Ian

Before I start - I am in Australia. Does that change anything - likw "setlocale".

ken

 

It is not too important providing you are using English :)

 

Thamks for this info it was invaluable.

 

appreciated

Link to comment
Share on other sites

  • 4 months later...

Just wanted to remind everyone but there is a english.php on the admin side too. eg. admin/include/.......... not just the catalog/include its the same as before jsut you have to change a line

 

// text for date of birth example

to dd/mm/yyyy

 

and leave out

 

define('ENTRY_DATE_OF_BIRTH_TEXT......

line becuase it dose not exsist in the the admin side

Link to comment
Share on other sites

So I want to change from DD/MM/YYYY

to YYYYMMDD-XXXX

 

I don't think you can use the DOB field in this way. The DOB field contains just a date, but your social security number is more than a date.

 

What you could do, however, is create an extra [user attibute] field for the control number, set the DOB format to YYYYMMDD and display these two fields side-by-side. The social security number would then be derived by joining these two fields together.

 

Don't ask me how to add new customer attributes though - I'm just about to embark on that with 2.2MS1, so I don't know quite what to change yet.

 

-- JJ

Link to comment
Share on other sites

  • 1 year later...

Archived

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

×
×
  • Create New...