I am working on a jquery calendar script.
In the script, selecting a row gives a date object as callback.
select: function(start, end, allDay) {
$("#datepicker_add").val(start);
$("#datepicker_add_end").val(end);
calendar.fullCalendar('renderEvent',
{
title: title,
start: start,
end: end,
allDay: allDay
},
true // make the event "stick"
);
calendar.fullCalendar('unselect');
},
Here that start and end objects are like that Wed Aug 22 2012 00:00:00 GMT+0300 (EEST)
What i want is to format this as Y-m-d
How can i do that ?
if you use Jquery UI as well you can use the DataPicker’s static convert methods:
you could also create a new Javascript date object and pass in your desired object off the get-go or use the various “get” functions to pull the pieces you want and reassemble as you need to:
http://www.w3schools.com/js/js_obj_date.asp