1
0
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:
galaxyoyo
2019-09-07 16:37:00 +02:00
parent 7266fe8e24
commit e5e197dd38
11 changed files with 109 additions and 52 deletions

17
server_files/utils.php Normal file
View 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;
}