add method checkDate()

This commit is contained in:
Uwe Steinmann 2015-07-31 15:30:00 +02:00
parent 4f3381a268
commit 3699adfaf5

View File

@ -186,6 +186,17 @@ class SeedDMS_Core_DMS {
return false;
} /* }}} */
/**
* Checks if date conforms to a given format
*
* @param string $date date to be checked
* @return boolean true if date is in propper format, otherwise false
*/
static function checkDate($date) { /* {{{ */
$d = DateTime::createFromFormat($format, $date);
return $d && $d->format($format) == $date;
} /* }}} */
/**
* Filter objects out which are not accessible in a given mode by a user.
*