I am currently using vRO 7.2 and am running into this issue, ive browed around some javascript websites for anyone who has written something similar but I never seen any have an issue with there calling of dates past 13 .Is this something funky in vRO or am I missing something?
var date = new Date();
var future_date = new Date();
var date_start = 1;
var date_range = 14;
var date_range_array = new Array();
while ( date_start <= date_range){
future_date.setDate(date.getDate()+ date_start);
System.log(future_date);
var numberOfMonth = future_date.getMonth() + 1 ;
var day = future_date.getDate();
var year = future_date.getFullYear();
var month;
//Conversion to Month from number
//---------------------------------------------------
if (numberOfMonth == "1"){
month = "Jan";
}
else if (numberOfMonth == "2"){
month = "Feb";
}
else if (numberOfMonth == "3"){
month = "Mar";
}
else if (numberOfMonth == "4"){
month = "Apr";
}
else if (numberOfMonth == "5"){
month = "May";
}
else if (numberOfMonth == "6"){
month = "Jun";
}
else if (numberOfMonth == "7"){
month = "Jul";
}
else if (numberOfMonth == "8"){
month = "Aug";
}
else if (numberOfMonth == "9"){
month = "Sept";
}
else if (numberOfMonth == "10"){
month = "Oct";
}
else if (numberOfMonth == "11"){
month = "Nov";
}
else if (numberOfMonth == "12"){
month = "Dec";
}
//---------------------------------------------------
var combineDate = month + "-" + day + "-" + year;
System.log(combineDate);
//---------------------------------------------------
date_start++;
}
Goal is to have it generate the date in a certain format but when it gets past day 13 it gets a little weird.
[2017-07-19 15:03:51.146] [I] Thu Jul 20 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.147] [I] Jul-20-2017
[2017-07-19 15:03:51.148] [I] Fri Jul 21 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.150] [I] Jul-21-2017
[2017-07-19 15:03:51.151] [I] Sat Jul 22 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.152] [I] Jul-22-2017
[2017-07-19 15:03:51.154] [I] Sun Jul 23 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.155] [I] Jul-23-2017
[2017-07-19 15:03:51.157] [I] Mon Jul 24 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.158] [I] Jul-24-2017
[2017-07-19 15:03:51.160] [I] Tue Jul 25 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.161] [I] Jul-25-2017
[2017-07-19 15:03:51.163] [I] Wed Jul 26 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.164] [I] Jul-26-2017
[2017-07-19 15:03:51.165] [I] Thu Jul 27 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.167] [I] Jul-27-2017
[2017-07-19 15:03:51.168] [I] Fri Jul 28 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.169] [I] Jul-28-2017
[2017-07-19 15:03:51.171] [I] Sat Jul 29 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.172] [I] Jul-29-2017
[2017-07-19 15:03:51.174] [I] Sun Jul 30 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.175] [I] Jul-30-2017
[2017-07-19 15:03:51.176] [I] Mon Jul 31 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.178] [I] Jul-31-2017
[2017-07-19 15:03:51.179] [I] Tue Aug 01 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.180] [I] Aug-1-2017
[2017-07-19 15:03:51.181] [I] Sat Sep 02 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.183] [I] Sept-2-2017
[2017-07-19 15:03:51.184] [I] Wed Oct 04 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.185] [I] Oct-4-2017
[2017-07-19 15:03:51.186] [I] Sat Nov 04 2017 19:03:51 GMT-0000 (UTC)
[2017-07-19 15:03:51.190] [I] Nov-4-2017
Thanks for the help in advance!