osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Dat of birth problem

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 ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > osCommerce 2.2 Modification Help

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 09-03-2004, 12:57 AM
New Member
 
Join Date: Sep 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
energeeuk
Default Dat of birth problem

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #2  
Old 09-03-2004, 05:54 AM
New Member
 
Join Date: Sep 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Guile
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 09-15-2004, 08:59 AM
Member
 
Join Date: Aug 2003
Location: Southampton UK
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
NickW
Default

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');
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 12-14-2004, 01:57 PM
New Member
 
Join Date: Dec 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
b2bcons
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 12-14-2004, 02:09 PM
Member
 
Join Date: Aug 2003
Location: Southampton UK
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
NickW
Default

see http://uk2.php.net/manual/en/function.strftime.php
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #6  
Old 12-14-2004, 03:06 PM
New Member
 
Join Date: Dec 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
b2bcons
Default tried this but still getting format error

Quote:
Originally Posted by NickW
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');

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.
__________________
Trevor Locke
Consultant
www.b2bwebconsultants.co.uk
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #7  
Old 01-18-2005, 05:39 AM
New Member
 
Join Date: Dec 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
b2bcons
Default reformatting date of birth

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?
__________________
Trevor Locke
Consultant
www.b2bwebconsultants.co.uk
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #8  
Old 01-18-2005, 06:38 AM
Lurker
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
mallers
Default RE: reformatting date of birth

Quote:
Originally Posted by b2bcons
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?
I have just done this today.
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #9  
Old 09-14-2005, 03:11 AM
Lurker
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
kyungeui
Default Change the date format for admin as well

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #10  
Old 09-14-2005, 03:17 AM
Lurker
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
kyungeui
Default RE: Change the date format for admin as well

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', ' <span class="errorText">(eg. 21/05/1970)</span>');
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
The Following User Says Thank You to kyungeui For This Useful Post:
typhus (01-17-2008)
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 02:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax