calendars: [],
loadedCalendars: [],
events: [],
+ eventCache: [],
/**
* Perform an Ajax action
// Add the link to view the event detail.
a = $('<a>').attr({'href': '#eventview'}).click(function(e) {
+ $('#eventview [data-role=content] ul').detach();
KronolithMobile.loadEvent(cal, id, Date.parse(event.e));
}).append(d);
loadEventCallback: function(data)
{
var event, list, text;
-
- $('#eventview [data-role=content] ul').detach();
if (!data.response.event) {
// @TODO: Error handling.
return;
*/
buildEventView: function(e)
{
- console.log(Kronolith);
var list = $('<ul>').addClass('kronolithEventDetail').attr({ 'data-role': 'listview', 'data-inset': true });
var loc = false, t;
case 5:
case 6:
case 7:
- // Yearly
+ default:
+ t.text('TODO');
}
//t.append($('<div>').addClass('kronolithEventDetailRecurring').text(Kronolith.text.recur[e.r.t]));
} else if (e.al) {
showNextDay: function()
{
$("#dayview [data-role=content] ul").detach();
- KronolithMobile.currentDate.addDays(1);
- $(".kronolithDayDate").html(KronolithMobile.currentDate.toString(Kronolith.conf.date_format));
- KronolithMobile.loadEvents(KronolithMobile.currentDate, KronolithMobile.currentDate);
+ var d = $('.kronolithDayDate').data('date');
+ d.addDays(1);
+ $(".kronolithDayDate").text(d.toString('ddd') + ' ' + d.toString('d'));
+ $('.kronolithDayDate').data('date', d);
+ KronolithMobile.loadEvents(d, d);
},
showPrevDay: function()
{
$("#dayview [data-role=content] ul").detach();
- KronolithMobile.currentDate.addDays(-1);
- $(".kronolithDayDate").html(KronolithMobile.currentDate.toString(Kronolith.conf.date_format));
- KronolithMobile.loadEvents(KronolithMobile.currentDate, KronolithMobile.currentDate);
+ var d = $('.kronolithDayDate').data('date');
+ d.addDays(-1);
+ $(".kronolithDayDate").text(d.toString('ddd') + ' ' + d.toString('d'));
+ KronolithMobile.loadEvents(d, d);
},
showPrevMonth: function()
});
// For now, start at today's day view
- KronolithMobile.currentDate = new Date();
+ var currentDate = new Date();
$('body').bind('swipeleft', KronolithMobile.showNextDay);
$('body').bind('swiperight', KronolithMobile.showPrevDay);
$('#dayview').bind('pageshow', function(event, ui) {
$('.kronolithDayHeader .kronolithNextDay').bind('click', KronolithMobile.showNextDay);
// Load today's events
- $(".kronolithDayDate").html(KronolithMobile.currentDate.toString(Kronolith.conf.date_format));
- KronolithMobile.loadEvents(KronolithMobile.currentDate, KronolithMobile.currentDate);
+ $(".kronolithDayDate").html(currentDate.toString('ddd') + ' ' + currentDate.toString('d'));
+ $('.kronolithDayDate').data('date', currentDate);
+ KronolithMobile.loadEvents(currentDate, currentDate);
// Set up the month view
// Build the first month, should due this on first page show, but the
// pagecreate event doesn't seem to fire for the internal page? Not sure how
// else to do it, so just build the first month outright.
- var date = KronolithMobile.currentDate;
- KronolithMobile.buildCal(date);
+ KronolithMobile.buildCal(currentDate);
$('#kronolithMinicalPrev').bind('click', KronolithMobile.showPrevMonth);
$('#kronolithMinicalNext').bind('click', KronolithMobile.showNextMonth);