From 442afe14a4acfc580ec157f65cb92e5dd567c9ad Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 2 Sep 2021 14:18:58 +0200 Subject: [PATCH] Improve quick poll template --- www/form/templates.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/www/form/templates.js b/www/form/templates.js index ff75f8254..d72c7ecb8 100644 --- a/www/form/templates.js +++ b/www/form/templates.js @@ -4,17 +4,21 @@ define([ Messages.form_type_poll = "Quick poll"; // XXX update key var pollValues = []; var d8 = new Date(); - d8.setDate(d8.getDate() - d8.getDay()); // set sunday + d8.setDate(d8.getDate() - d8.getDay() + 7); // set sunday d8.setHours(8); d8.setMinutes(0); d8.setSeconds(0); d8.setMilliseconds(0); var d14 = new Date(d8); d14.setHours(14); - [0,1,2].forEach(function () { + [0,1,2].forEach(function (el) { d8.setDate(d8.getDate() + 1); d14.setDate(d14.getDate() + 1); + if (el === 2) { + d8.setHours(10); + } pollValues.push(+d8); + if (el === 2) { return; } pollValues.push(+d14); }); return [{