| Summary | emptyDateArray assumes 3 date components |
| Queue | Horde Framework Packages |
| Queue Version | HEAD |
| Type | Enhancement |
| State | Resolved |
| Priority | 2. Medium |
| Owners | |
| Requester | robin (at) rainton (dot) com |
| Created | 12/14/2005 (7312 days ago) |
| Due | |
| Updated | 11/16/2006 (6975 days ago) |
| Assigned | |
| Resolved | 11/16/2006 (6975 days ago) |
| Milestone | |
| Patch | No |
State ⇒ Resolved
State ⇒ Accepted
Priority ⇒ 2. Medium
Version ⇒ HEAD
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ emptyDateArray assumes 3 date components
Queue ⇒ Horde Framework Packages
example, when initialising a form ($this):
$this->addVariable(_("Start Date"), 'start', 'monthDayYear', true);
$this->addVariable(_("Start Time"), 'start', 'hourMinuteSecond', true);
Which works as expected, but breaks the validation function, which
should probably read:
function emptyDateArray($date)
{
if (!is_array($date)) {
return empty($date);
}
$empty = 0;
$parts = 0;
/* Check each date array component. */
foreach ($date as $key => $val) {
$parts++;
if (empty($val)) {
$empty++;
}
}
/* Check state of empty. */
if ($empty == 0) {
/* If no empty parts return 0. */
return 0;
} elseif ($empty == $parts) {
/* If all empty parts return 1. */
return 1;
} else {
/* If some empty parts return -1. */
return -1;
}
}