You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.
define ( [
'/customize/messages.js'
] , function ( Messages ) {
Messages . form _template _poll = "Quick poll" ; // XXX update key
var pollValues = [ ] ;
var d8 = new Date ( ) ;
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 ( 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 [ {
id : 'a' ,
used : 1 ,
name : Messages . form _template _poll ,
content : {
answers : {
anonymous : true ,
} ,
form : {
"1" : {
type : 'md'
} ,
"2" : {
type : 'poll' ,
opts : {
type : 'time' ,
values : pollValues
}
}
} ,
order : [ "1" , "2" ]
}
} ] ;
} ) ;