Changeset 221 for tags/2.0.2/lib


Ignore:
Timestamp:
Dec 18, 2006 5:47:34 PM (18 years ago)
Author:
quinn
Message:

Q - Fixed codebase css bug where class="error" was still being used for the FV. Fixed StrTime? bug.

Location:
tags/2.0.2/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tags/2.0.2/lib/FormValidator.inc.php

    r220 r221  
    491491    function validateStrDate($form_name, $msg='')
    492492    {
     493        if ('' == getFormData($form_name)) {
     494            // Empty string is okay
     495            return true;
     496        }
    493497        $timestamp = strtotime(getFormData($form_name, '0'));
    494498        if ($timestamp === -1 || $timestamp === false) {
  • tags/2.0.2/lib/Utilities.inc.php

    r220 r221  
    495495    // Translate the human string date into SQL-safe date format.
    496496    if (empty($date) || strpos($date, '0000-00-00') !== false || strtotime($date) === -1 || strtotime($date) === false) {
    497         return '0000-00-00';
     497        // Return a string of zero time, formatted the same as $format.
     498        return strtr($format, array(
     499            'Y' => '0000',
     500            'm' => '00',
     501            'd' => '00',
     502            'H' => '00',
     503            'i' => '00',
     504            's' => '00',
     505        ));
    498506    } else {
    499507        return date($format, strtotime($date));
Note: See TracChangeset for help on using the changeset viewer.