I am building an online timesheet.
In the paper version, the user needs to write in the date for each row (clearly less than ideal).
In Laserfiche Forms, I would like to have the user enter the first date of the pay period (in a Date field), then have the row labels populate automatically with the dates of the pay period.
I don't know Javascript, but I've done a lot of searching in this forum and have made some progress. Where I'm stuck is getting the date to increment. Taking a date of 3/31/2020 and adding one returns 3/31/20201. I think maybe I need to convert back into a date format? I've tried a variety of things without success, and the addDays function in Javascript doesn't seem to work at all. I also don't need the hours, minutes, and seconds, just the day, month, year.
Here's what I have so far; can someone please help?
/* Date Range in Row Labels */
$(document).ready(function () {
$(".startdate input").change(function(){
setDateRange();
});
function setDateRange(){
var startdate=$('.startdate input').val();
var parent = document.getElementById('q115');
var label = parent.getElementsByClassName('col0');
var day1 = startdate;
var day2 = startdate + 1;
label[0].innerHTML = day1
label[1].innerHTML = day2
}
});
day1 returns correctly
day2 just returns day1 with the number 1 appended to the end
Thanks in advance!