X-Git-Url: https://git.p6c8.net/jirafeau_project.git/blobdiff_plain/430990d5fa8922bf23560ea9734040331dd199ac..117541049ca0a09a13a40fc0a5e686e334334fae:/lib/functions.php diff --git a/lib/functions.php b/lib/functions.php index b053aaa..fd0fe2c 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; +}