X-Git-Url: https://git.p6c8.net/jirafeau_project.git/blobdiff_plain/17431c71e3da077f11da9b10a9598bf7bd90918c..59735150f2d8b5cbbc6d7c15922e7e1412bbbcb4:/lib/functions.php diff --git a/lib/functions.php b/lib/functions.php index 2378d76..d40feb2 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1843,3 +1843,36 @@ function jirafeau_get_expiration_time_options() { echo ''; } + function jirafeau_datestr_to_int ($time_str) { + $time = time(); + switch ($time_str) { + case 'minute': + $time += JIRAFEAU_MINUTE; + break; + case 'hour': + $time += JIRAFEAU_HOUR; + break; + case 'day': + $time += JIRAFEAU_DAY; + break; + case 'week': + $time += JIRAFEAU_WEEK; + break; + case 'fortnight': + $time += JIRAFEAU_FORTNIGHT; + break; + case 'month': + $time += JIRAFEAU_MONTH; + break; + case 'quarter': + $time += JIRAFEAU_QUARTER; + break; + case 'year': + $time += JIRAFEAU_YEAR; + break; + default: + $time = JIRAFEAU_INFINITY; + break; + } + return $time; +}