Tuesday, December 11, 2012

Modified Google Trusted Stores Date

Below is modified JavaScript to add 7 days to the Google Trusted Stores code ship date.

var d = new Date();
var seven_date = d.getDate();
var curr_month = d.getMonth();
if (seven_date < 22) {
  var curr_year = d.getFullYear();
  var seven_date_two = seven_date + parseInt(7);
  if (curr_month < 9) {var curr_month_two = "0" + curr_month;} else {var curr_month_two = curr_month;}
  var weekDate =(curr_year + "-" + curr_month_two + "-" + seven_date_two);
}
else if (curr_month > 12) {
  var curr_year = d.getFullYear()+1;
  var curr_month_two = "01";
  var weekDate =(curr_year + "-" + curr_month_two + "-" + seven_date_two);
}
else {
  var curr_year = d.getFullYear();
  var curr_month_two = curr_month + parseInt(1);
  if (curr_month_two < 9) {var curr_month_three = "0" + curr_month_two;} else {var curr_month_three = curr_month_two;}
  var seven_date_two = "07";
  var weekDate =(curr_year + "-" + curr_month_three + "-" + seven_date_two);
}

No comments:

Post a Comment