Re: Re: QuickForm compare/validate dates
| From: | Ignatius Reilly | Date: | Wed, 15 Feb 2006 10:38:15 +0000 |
| Subject: | Re: Re: QuickForm compare/validate dates | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-22977@lists.php.net to get a copy of this message | ||
cwhisperer thus spake on 2006-02-15 11:21:
do you have an example? thx Ignatius Reilly wrote:Now to compare the dates in your callback function, you have several options: - use a SQL request - use PEAR Date: require_once "Date.php"; $cmp = Date_Calc::compareDates( $fields['date1']['d'], $fields['date1']['M']), $fields['date1']['Y'], $fields['date2']['d'], $fields['date2']['M']), $fields['date2']['Y'], ); var_dump( $cmp );cwhisperer thus spake on 2006-02-15 09:34:Hi, In a form I have two dates and want to validate so that date2 > date1. How I do that? Regards A.Use a Form Rule For implementing a Form Rule, see the example on the online doc