From: Michael Tremer Date: Wed, 29 Oct 2025 15:56:04 +0000 (+0000) Subject: time: Parse multipliers the other way round X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4112dcb74738cfd1ab8832585f8bc242151ef6e5;p=collecty.git time: Parse multipliers the other way round Signed-off-by: Michael Tremer --- diff --git a/src/daemon/time.c b/src/daemon/time.c index 8a3e8d5..7a92b75 100644 --- a/src/daemon/time.c +++ b/src/daemon/time.c @@ -31,29 +31,29 @@ static int find_multiplier(char** p) { const char* unit; int multiplier; } multipliers[] = { - { "seconds", 1 }, - { "second", 1 }, - { "sec", 1 }, - { "s", 1 }, - { "minutes", 60 }, - { "minute", 60 }, - { "min", 60 }, - { "m", 60 }, + { "years", 3600 * 24 * 365 }, + { "year", 3600 * 24 * 365 }, + { "months", 3600 * 24 * 30 }, + { "month", 3600 * 24 * 30 }, + { "weeks", 3600 * 24 * 7 }, + { "week", 3600 * 24 * 7 }, + { "w", 3600 * 24 * 7 }, + { "days", 3600 * 24 }, + { "day", 3600 * 24 }, + { "d", 3600 * 24 }, { "hours", 3600 }, { "hour", 3600 }, { "hrs", 3600 }, { "hr", 3600 }, { "h", 3600 }, - { "days", 3600 * 24 }, - { "day", 3600 * 24 }, - { "d", 3600 * 24 }, - { "weeks", 3600 * 24 * 7 }, - { "week", 3600 * 24 * 7 }, - { "w", 3600 * 24 * 7 }, - { "months", 3600 * 24 * 30 }, - { "month", 3600 * 24 * 30 }, - { "years", 3600 * 24 * 365 }, - { "year", 3600 * 24 * 365 }, + { "minutes", 60 }, + { "minute", 60 }, + { "min", 60 }, + { "m", 60 }, + { "seconds", 1 }, + { "second", 1 }, + { "sec", 1 }, + { "s", 1 }, { NULL }, };