This is a discussion on Dat of birth problem within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Hi I'm VERY new to oscommerce and just have a small question I'm trying to change the date of birth ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Hi I'm VERY new to oscommerce and just have a small question I'm trying to change the date of birth to english formated (when you create a new account). ie to read 24/01/1923 in stead of 01/24/1923 Thanks EnergeeUK |
|
#2
| |||
| |||
| php occurs in blocks surrounded by commenting. this commenting tells non programmers like you and me what each module of code is for. you would need to find the file that contains the date and just copy and paste them into the new order. ie change the order of the three modules. or they may be parts of one you wont know until you find the code. there is an article that will get you up to speed in the oscdox at chapter three of the mod guide, exercise 1. |
|
#3
| |||
| |||
| The date formats are defined in catalog\includes\languages\english.php Open english.pphp for editing and search for DOB_FORMAT_STRING, JS_DOB, ENTRY_DATE_OF_BIRTH_ERROR, DATE_FORMAT_SHORT, DATE_FORMAT_LONG, DATE_FORMAT and change: setlocale(LC_TIME, 'en_US.ISO_8859-1'); to: setlocale(LC_TIME, 'en_GB.ISO_8859-1'); |
|
#4
| |||
| |||
| I am trying to do this but having problems interpreting define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime() Not sure what %A or %B is |
|
#5
| |||
| |||
| |
|
#6
| |||
| |||
| Quote:
Yes I did all this but its still returning an error even when I enter 01/01/1978 into the Date of Birth box. Could not locate JS_DOB in the code for english.php - does that matter. Could anyone show an example of the modified code for UK format date of birth entry. |
|
#7
| |||
| |||
| I was hoping someone could deal with my posting about how to reform a date field from US to UK format. I have tried all the solutions that have already been posted, without success. So, where am I going wrong? |
|
#8
| |||
| |||
| Quote:
Edit catalog/includes/languages/english.php Change the return statements as detailed below...... // Return date in raw format // $date should be in format dd/mm/yyyy (changed from supplied default) // 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); } } Because the other settings where changed from mm/dd/yyyy to dd/mm/yyyy, you needed to change the statements shown to extract the day and month from the different positions in $date. Seems to work ok for me. It gets me through the registration screen and it displays correctly when I look at my account details later. Regards Ian |
|
#9
| |||
| |||
| Hi all. I have successfully got the fix working. But the problem is with the admin page. When I try to change the date of birth of a customer it's still in the MM/DD/YY format. Also the "account created" date is in MM/DD/YY format. Does any one have any ideas on how to fix the admin date format. Cheers |
|
#10
| |||
| |||
| I have fixed it. You need to change the same stuff as the before. Basically change to the following stuff 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 date() define('PHP_DATE_TIME_FORMAT', 'd/m/Y H:i:s'); // this is used for date() 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); } } define('DOB_FORMAT_STRING', 'dd/mm/yyyy'); define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<span class="errorText">(eg. 21/05/1970)</span>'); |
| The Following User Says Thank You to kyungeui For This Useful Post: | ||
typhus (01-17-2008) | ||
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Email problem on webmail n aslo cupons problem | jikey | osCMax v2 Installation issues | 0 | 10-25-2006 11:43 PM |
| How to remove date of birth from registration??? | stando | osCMax v1.7 Discussion | 3 | 07-29-2004 08:10 PM |
| How do i remove the Date of birth field in new account | forsythi | osCommerce 2.2 Modification Help | 3 | 12-16-2003 01:59 AM |