Is there anyway to calculate date range from today until selected date?
Confluence User - 23 Jun, 2021
Currently I am trying to use hash variable in my javascript to calculate the date range from the selected day I picked but it doesn't work, here are my code
<script type="text/javascript">
$(input[name="start"]').change( function(){
d1 = $('input[name="start"]').datepicker('getDate');
d2 = #date.yyyy-MM-dd#;
diff = 0;
if (d1 && d2) {
diff = Math.floor((d2.getTime() - d1.getTime()) / 86400000); // ms per day
}
$('input[name=testing]').val(diff);
});
</script>
so I wonder is there other approach for getting the date range?
datetime;javascript