changeset 1024:11b75fdc84de

irccd: fix Date.now() which returns milliseconds
author David Demelier <markand@malikania.fr>
date Tue, 23 Feb 2021 20:57:37 +0100
parents 8a91fe89c94f
children 49a126e8aed0
files irccd/jsapi-util.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/irccd/jsapi-util.c	Tue Feb 23 17:12:59 2021 +0100
+++ b/irccd/jsapi-util.c	Tue Feb 23 20:57:37 2021 +0100
@@ -81,7 +81,7 @@
 		}
 
 		if (strcmp(duk_get_string(ctx, -2), "date") == 0)
-			pkg->subst.time = duk_get_number(ctx, -1);
+			pkg->subst.time = duk_get_number(ctx, -1) / 1000;
 		else {
 			pkg->kw = irc_util_reallocarray(pkg->kw, ++pkg->subst.keywordsz,
 			    sizeof (*pkg->kw));