Changeset 221 for tags/2.0.2/lib
- Timestamp:
- Dec 18, 2006 5:47:34 PM (18 years ago)
- Location:
- tags/2.0.2/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/2.0.2/lib/FormValidator.inc.php
r220 r221 491 491 function validateStrDate($form_name, $msg='') 492 492 { 493 if ('' == getFormData($form_name)) { 494 // Empty string is okay 495 return true; 496 } 493 497 $timestamp = strtotime(getFormData($form_name, '0')); 494 498 if ($timestamp === -1 || $timestamp === false) { -
tags/2.0.2/lib/Utilities.inc.php
r220 r221 495 495 // Translate the human string date into SQL-safe date format. 496 496 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 )); 498 506 } else { 499 507 return date($format, strtotime($date));
Note: See TracChangeset
for help on using the changeset viewer.