Using this code on my page to display upcoming dates for the next few days, but it's not functioning as expected:
<script>
var now = new Date();
var day = ("0" + (now.getDate()+3)).slice(-2);
var day2 = ("0" + (now.getDate()+4)).slice(-2);
var month = ("0" + (now.getMonth() + 1)).slice(-2);
var today = (month)+"/"+(day)+"/"+now.getFullYear();
var today2 = (month)+"/"+(day2)+"/"+now.getFullYear();
document.write(today); document.write(' and/or ');document.write(today2);
</script>
However, the output is incorrect:
currently scheduled for: 05/32/2017 and/or 05/33/2017
I'm looking to adjust the code so that if necessary, it moves to the next month when adding 1. How can I achieve this?