I am working on one project and i am using FullCalendar
and jQuery dialog.
I am using jQuery
dialog because user select any time-slot they will be see one dialog box and inside of that dialog box i will pass start and end time.
But problem is that fullCalendar
pass start
argument as date object
which is Date {Tue Apr 02 2013 00:00:00 GMT+0530 (India Standard Time)}
now problem is that how can just display 02-04-2013 00:00:00
i do not want to use more plugin as its already have too much js included.
What i have?
jQuery Dialog code
$( "#dialog-form" ).dialog({
autoOpen: false,
modal: true,
buttons:
{
"Create an event": function()
{
var bValid = true;
if ( bValid )
{
//adding event to calendar code
$( this ).dialog( "close" );
}
},
Cancel: function()
{
$( this ).dialog( "close" );
}
},
close: function()
{
allFields.val( "" ).removeClass( "ui-state-error" );
}
});
FullCalendar
var calendar = $('#calendar').fullCalendar(
{
header:
{
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
selectable: true,
selectHelper: true,
select: function(start, end, allDay)
{
console.log(start);
$("#dialog-form input#start_time").val(start);
$("#dialog-form input#end_time").val(end);
$( "#dialog-form" ).dialog( "open" );
calendar.fullCalendar('unselect');
},
I pasted only half code here because its too long and its not necessary to add it here.
Thanks