PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Bug #4517

compare doesn't work for dates

Details

Submitted2005-06-02 23:12 UTC
Fromebryn at itlx dot com
StatusBogus
PackageHTML_Quickform
PHP Version5.0.3
OSLinux
Roadmaps(Not assigned)

Comments

[2005-06-02 23:12 UTC] ebryn at itlx dot com

Description:
------------
I'm trying to compare 2 dates. Looks like neither the server/client side validation does the job.

Reproduce code:
---------------
// Start date text field
$form->addElement('date', 'startDate', 'Start Date:');
// End date text field
$form->addElement('date', 'endDate', 'End Date:');

$form->addRule(array('startDate', 'endDate'), 'End date must be after start date', 'compare', '<=', 'client');

Expected result:
----------------
If startDate is less than or equal to endDate it should give an error.

Actual result:
--------------
No matter what values you choose, an error is triggered that the end date is before the start date.