mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Add phone limit creation to phone creation
This commit is contained in:
parent
fd1e7b5519
commit
298bba0c39
8 changed files with 231 additions and 21 deletions
|
@ -165,6 +165,24 @@ namespace controllers\internals;
|
|||
return $objectDate && $objectDate->format($format) === $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a relative format date (see https://www.php.net/manual/en/datetime.formats.relative.php) is valid.
|
||||
*
|
||||
* @param string $date : Relative date
|
||||
*
|
||||
* @return bool : True if valid, false else
|
||||
*/
|
||||
public static function validate_relative_date($date)
|
||||
{
|
||||
try {
|
||||
$d = new \DateTime($date);
|
||||
} catch (\Throwable $th) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a sting represent a valid PHP period for creating an interval.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue