Hi I was wondering how I can implement a Custom Code. I have been trying to implement the following code into my Survey, but unfortunaley I haven't been able to do so.
I want my Survey to change the date automatically in a Weekly fashion. Meaning that It shows monday Next week and the following days.
In addition I wanted the Survey to show the Current and following Calender Week.
I found these codes:
-
Calculate week number of current date - //define a date object variable that will take the current system date
- todaydate = new Date();
- //find the year of the current date
- var oneJan = new Date(todaydate.getFullYear(), 0, 1);
- // calculating number of days in given year before a given date
- var numberOfDays = Math.floor((todaydate - oneJan) / (24 * 60 * 60 * 1000));
- // adding 1 since to current date and returns value starting from 0
- var result = Math.ceil(( todaydate.getDay() + 1 + numberOfDays) / 7);
- //display the calculated result
- document.write("Week Numbers of current date (" + todaydate +
") is:
I would highly apreciate any kind of help, as I don't really know how to do this.
Expecially how I can make the code display its' result in the Survey.