Improve quick poll template
parent
e9a4416820
commit
442afe14a4
|
@ -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 [{
|
||||
|
|
Loading…
Reference in New Issue