cvs: pear /DB_Table/DB/Table QuickForm.php

From: Date: Tue, 22 Feb 2005 16:44:03 +0000
Subject: cvs: pear /DB_Table/DB/Table QuickForm.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-29677@lists.php.net to get a copy of this message
pmjones Tue Feb 22 11:44:03 2005 EDT Modified files: /pear/DB_Table/DB/Table QuickForm.php Log: Added request 3018 (allow custom formats for date, time, timestamp in QuickForms). WARNING: The automatic casting of date/time values may not work when specifying custom formats for QF elements. The user who changes these format values has to manually modify the string returned from a QF form to a format acceptable by DB_Table (i.e., "yyyy-mm-dd" or "hh:ii:ss") before attempting to insert or update; otherwise, data-level validation will fail. http://cvs.php.net/diff.php/pear/DB_Table/DB/Table/QuickForm.php?r1=1.16&r2=1.17&ty=u Index: pear/DB_Table/DB/Table/QuickForm.php diff -u pear/DB_Table/DB/Table/QuickForm.php:1.16 pear/DB_Table/DB/Table/QuickForm.php:1.17 --- pear/DB_Table/DB/Table/QuickForm.php:1.16 Tue Feb 22 10:51:39 2005 +++ pear/DB_Table/DB/Table/QuickForm.php Tue Feb 22 11:44:03 2005 @@ -22,7 +22,7 @@ * DB_Table_QuickForm provides HTML form creation facilities based on * DB_Table column definitions transformed into HTML_QuickForm elements. * -* $Id: QuickForm.php,v 1.16 2005/02/22 15:51:39 pmjones Exp $ +* $Id: QuickForm.php,v 1.17 2005/02/22 16:44:03 pmjones Exp $ * * @author Paul M. Jones <pmjones@ciaweb.net> * @@ -305,7 +305,9 @@ case 'date': - $col['qf_opts']['format'] = 'Y-m-d'; + if (! isset($col['qf_opts']['format'])) { + $col['qf_opts']['format'] = 'Y-m-d'; + } $element =& HTML_QuickForm::createElement( 'date', @@ -323,7 +325,9 @@ case 'time': - $col['qf_opts']['format'] = 'H:i:s'; + if (! isset($col['qf_opts']['format'])) { + $col['qf_opts']['format'] = 'H:i:s'; + } $element =& HTML_QuickForm::createElement( 'date', @@ -341,7 +345,9 @@ case 'timestamp': - $col['qf_opts']['format'] = 'Y-m-d H:i:s'; + if (! isset($col['qf_opts']['format'])) { + $col['qf_opts']['format'] = 'Y-m-d H:i:s'; + } $element =& HTML_QuickForm::createElement( 'date',

« previous php.pear.cvs (#29677) next »