|
-
Senior Member
I'm not sure I understand, but I think you're saying you need to start with a user-input date, in the form: YY.MM.DD, which is stored in the string variable otplata.
You should replace the lines:
var dat = new Date();
yr = dat.getFullYear(); // get current year
mn = dat.getMonth(); // get current month (0-11)
in my code above with this snippet:
// read the date from a string
datAry = otplata.split('.');
yr = datAry[0] + 2000; // full year
mn = datAry[1] - 1; // month in 0-11 format
Then it will compute the pay periods from that time on forward. Change the number 52 to the number of actual pay periods you want.
Don't worry about your leap-year restriction - just use full years (2004) for the computation, and the code will work for quite a long time to come.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|