Good morning. At work we have a system that tracks access to data so that people must re-request access to their data (to ensure people don't have access to data after thier requirement has ended).
The system requires us to manually add in a start date and an end date but as the start date is always todays date and the end date is 99% of the time 6 months from that date, I decided to make a javascript injection bookmark that would automatically enter these dates for us. (I know that adding 6 months, taking into account different number of days in a month is difficult but even a rough date would save us time).
What I am having trouble with is setting the date into a variable because it's in one line. Can anyone help with this? I have pasted what I have come up with so far but it doesn't work. If I take out the vars and put strings in it works fine.
Code:javascript:void(var now=new Date(),var end=now+(182*24*60*60*1000),document.forms[0].accessStart.value=now.format("dd/mm/yyyy"),document.forms[0].accessEnd.value=now.format("dd/mm/yyyy"))


Reply With Quote

Bookmarks