mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-25 12:17:27 +02:00
Début de gestion des mails et quelques modifications
This commit is contained in:
17
server_files/utils.php
Normal file
17
server_files/utils.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
function ensure($bool, $error_msg = "") {
|
||||
if (!$bool)
|
||||
throw new AssertionError($error_msg);
|
||||
}
|
||||
|
||||
function formatDate($date = NULL, $with_time = false) {
|
||||
if ($date == NULL)
|
||||
$date = date("yyyy-mm-dd");
|
||||
|
||||
return strftime("%d %B %G" . ($with_time ? " %H:%M" : ""), strtotime($date));
|
||||
}
|
||||
|
||||
function dateWellFormed($date, $format = "yyyy-mm-dd") {
|
||||
return date_parse_from_format($format, $date) !== false;
|
||||
}
|
Reference in New Issue
Block a user