Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.2

Bug #8105 Add support for 'g' date element format option
Submitted: 2006-07-03 07:12 UTC
From: dsanders at baselinesolutions dot com dot au Assigned: justinpatrin
Status: Closed Package: DB_DataObject_FormBuilder (version 1.0.0RC5)
PHP Version: 4.3.10 OS: FC2
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 35 - 12 = ?

 
 [2006-07-03 07:12 UTC] dsanders at baselinesolutions dot com dot au (David Sanders)
Description: ------------ It'd great to just add the 'g' QuickForm date element format option to _date2array() and _array2date(). (The 'g' is 'h' without any leading zeroes) Should be simple enough :) (See bug #3733)

Comments

 [2006-12-07 06:44 UTC] dsanders at baselinesolutions dot com dot au
Ok lazy bones here's a patch ;) @@ -2460,6 +2460,7 @@ class DB_DataObject_FormBuilder if ($da['h'] == 0) { $da['h'] = 12; } + $da['g'] = $da['h']; $da['i'] = $dObj->getMinute(); $da['s'] = $dObj->getSecond(); if ($da['H'] >= 12) { @@ -2482,6 +2483,7 @@ class DB_DataObject_FormBuilder $da['Y'] = $da['y'] = date('Y', $time); $da['H'] = date('H', $time); $da['h'] = date('h', $time); + $da['g'] = date('g', $time); $da['i'] = date('i', $time); $da['s'] = date('s', $time); $da['a'] = date('a', $time); @@ -2525,8 +2527,12 @@ class DB_DataObject_FormBuilder } if (isset($dateInput['H'])) { $hour = $dateInput['H']; - } elseif (isset($dateInput['h'])) { - $hour = $dateInput['h']; + } elseif (isset($dateInput['h']) || isset($dateInput['g'])) { + if (isset($dateInput['h'])) { + $hour = $dateInput['h']; + } elseif (isset($dateInput['g'])) { + $hour = $dateInput['g']; + } if (isset($dateInput['a'])) { $ampm = $dateInput['a']; } elseif (isset($dateInput['A'])) { Now the g in _date2array() isn't strictly necessary because HTML_QuickForm_date::setValue() creates everything from a call to date() anyway.
 [2006-12-07 07:04 UTC] dsanders at baselinesolutions dot com dot au
Changed from request to bug as this might catch other people out...
 [2006-12-07 07:21 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!