Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » RADICORE Suggestions » date validation
date validation [message #70] Mon, 12 June 2006 21:06 Go to next message
semcycle is currently offline  semcycle
Messages: 8
Registered: June 2006
Location: Michigan, USA
Junior Member
it would be nice to have support for the US m(m)/d(d)/yy(yy) date format as well. for now i have just hacked std.datevalidation.class.inc as follows

function getInternalDate ($input)
// convert date from external format (as input by user)
// to internal format (as used in the database)
{


// ************** this part changed from
/*
// look for d(d)?m(m)?y(yyy) format
$pattern = '(^[0-9]{1,2})' // 1 or 2 digits
. '([^0-9a-zA-Z])' // not alpha or numeric
. '([0-9]{1,2})' // 1 or 2 digits
. '([^0-9a-zA-Z])' // not alpha or numeric
. '([0-9]{1,4}$)'; // 1 to 4 digits
if (ereg($pattern, $input, $regs)) {
$result = $this->verifyDate($regs[1], $regs[3], $regs[5]);
return $result;
} // if
*/

// ****************** changed to

// change to m/d/y format for US users

// look for m(m)?d(d)?y(yyy) format
$pattern = '(^[0-9]{1,2})' // 1 or 2 digits
. '([^0-9a-zA-Z])' // not alpha or numeric
. '([0-9]{1,2})' // 1 or 2 digits
. '([^0-9a-zA-Z])' // not alpha or numeric
. '([0-9]{1,4}$)'; // 1 to 4 digits
if (ereg($pattern, $input, $regs)) {
$result = $this->verifyDate($regs[3], $regs[1], $regs[5]);
return $result;
} // if

maybe somewhere along the way there could be some user preference settings such as date format, time zone etc ?



Sem Abrahams
www.semcycle.com
Re: date validation [message #71 is a reply to message #70] Tue, 13 June 2006 04:19 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
In the next release I will put a date format option in config.inc to switch between the 'dmy' and 'mdy' formats.

Ability to display dates in the yyyy-mm-dd format [message #3573 is a reply to message #71] Fri, 01 March 2013 08:00 Go to previous messageGo to next message
jjtoranzo2004 is currently offline  jjtoranzo2004
Messages: 261
Registered: September 2012
Senior Member
Tony,

It would be nice to have the ability to display dates in the yyyy-mm-dd format, maybe with a corresponding entry in config.inc like

//$GLOBALS['date_format'] = 'yyyy-mm-dd';  // '2001-06-21'


Re: Ability to display dates in the yyyy-mm-dd format [message #3574 is a reply to message #3573] Sat, 02 March 2013 09:30 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
This will be available in the next release which will be coming shortly.

Re: Ability to display dates in the yyyy-mm-dd format [message #3591 is a reply to message #3574] Thu, 21 March 2013 09:42 Go to previous message
jjtoranzo2004 is currently offline  jjtoranzo2004
Messages: 261
Registered: September 2012
Senior Member
Thanks Tony for making that format available.
Previous Topic: Date picker
Next Topic: Traversing subtrees
Goto Forum:
  


Current Time: Tue Dec 03 13:22:36 EST 2024

Total time taken to generate the page: 0.01095 seconds