I am using a jQuery calendar to display events, which is designed to pull data from the server. On innit the calendar fires off a AJAX request to get an array of events objects
Try to use date.toISOString()
to pass data to server. It returns string in ISO8601 format. Also this method can be used to format dates for using in uri.
$.post('/planner/GetPlannerEvents', { start: start.toISOString(),
end: end.toISOString() }, function (result) {
callback(result);
});
Why toISOString
is better than toUTCString
?
toUTCString
converts to human readable string in the UTC time zone.
toISOString
converts to universal ISO format which allows to resolve issue with regional settings and different formats.