Getting a simple timestamp from the FullCalendar event object

GesInsakewems

New Member
I already got my FullCalendar feeds working well by defining an eventSource.\[code\]eventSources: [{ events: function(start, end, callback) { $.ajax({ url: svcURL, dataType: 'json', type: 'POST', data: { start: Math.round(start.getTime() / 1000), end: Math.round(end.getTime() / 1000), sid: %sid%, csrf_test_name: csrf }, success: function(json) { callback(json); } }); }}\[/code\]I got my timestamps perfect by copying and pasting from the examples. However, I have another ajax function with which I want to use timestamps as well, but instead of timestamps I'm getting a text version of the data:\[code\]eventClick: function(event) { if (confirm('Quer mesmo marcar este servi?o?')){ markit(event); } return false;}\[/code\]The eventClick function passes the event object to my "markit" function:\[code\]function markit(obj){ $.ajax({ url: msvURL, dataType: 'json', type: 'POST', data: { start: obj.start, end: obj.end, sid: obj.sid, uid: obj.uid, aid: obj.aid, csrf_test_name: csrf }, success: function(json) { alert('Got it marked!') } });}\[/code\]As I said, the markit function doesn't pass a timestamp for 'start' and 'end' so the data is harder to work with. How can I convert the times to timestamps?UPDATE: The text version that is being sent is as follows:\[code\]Tue Mar 19 2013 09:30:00 GMT-0300 (Hora oficial do Brasil)\[/code\]Although I can parse that with PHP, life would be much simpler if I could work with timestamps.
 
Back
Top