JSFiddle - React, Tailwind, and code Playground

by toutgreg

HTML

<form>
<select name="departure" id="departure">
    <option ><script>document.write(today);</script></option>
    <option ><script>document.write(tomorrow);</script></option>
    <option ><script>document.write(dayaftertomorrow);</script></option>
</select>
</form>

JavaScript

var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
if(dd<10) {
    dd='0'+dd
} 
if(mm<10) {
    mm='0'+mm
} 
today = dd+'/'+mm;

//---------- 
var tomorrow = new Date(new Date().getTime() + 86400000);
var day = tomorrow.getDate()
var month = tomorrow.getMonth() + 1
if(day<10) {
    day='0'+day
} 
if(month<10) {
    month='0'+month
} 
tomorrow = day+'/'+month

//---------- 
var aftertomorrow = new Date(new Date().getTime() + 172800000);
var afterday = aftertomorrow.getDate()
var aftermonth = aftertomorrow.getMonth() + 1
if(afterday<10) {
    afterday='0'+afterday
} 
if(aftermonth<10) {
    aftermonth='0'+aftermonth
} 
aftertomorrow = afterday+'/'+aftermonth