I am attempting to transform my date into ISO format and adjust the hours to 23. Below is my code:
var currDateEnd = $('#calendar').fullCalendar('getView').start;
console.log(currDateEnd);
currDateEnd.toDate().toISOString();
console.log(currDateEnd);
currDateEnd.setHours(23);
OUTPUT
Mon Oct 19 2015 02:00:00 GMT+0200 (ora legale Europa occidentale)
Mon Oct 19 2015 02:00:00 GMT+0200 (ora legale Europa occidentale)
However, I encounter an error on the last line:
currDateEnd.setHours is not a function
What could be causing this issue? Is there a solution to rectify it?
UPDATE
Upon running the following code:
var currDateEnd = $('#calendar').fullCalendar('getView').start;
console.log("currDateEnd iso => ", currDateEnd.toDate().toISOString());
The output generated is as follows:
currDateEnd iso => 2015-10-19T00:00:00.000Z