Home » Bug #4517
compare doesn't work for dates
Details
| Submitted | 2005-06-02 23:12 UTC |
|---|---|
| From | ebryn at itlx dot com |
| Status | Bogus |
| Package | HTML_Quickform |
| PHP Version | 5.0.3 |
| OS | Linux |
| 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.