I am using this calendar for Titanium SDK. What I need to do is retrieve a list of dates from a server, and if a date on the calendar has an event, add an image to the tile to represent that. I can retrieve the day, but the problem is the day is not specific to the date. For example if the date retrieved was 08/12/2012, the day is equal to 8. When I go to set the image in the code like so:
calendar.setImage(eventDay, 'path/to/image');
it sets the 8th day of every month and not just the the the 8th of December.
Here is the setImage function from the calendar controller:
exports.setImage = function(day,image, options) {
var _ref3;
if (options == null) {
options = {};
}
if (moment.isMoment()) {
day = day.date();
}
tile = (_ref3 = $.calendar) != null ? _ref3["" + day] : void 0;
if ((tile != null ? tile.date : void 0) != null) {
tile.remove(tile.children[0]);
_.extend(tile, {
_isEntry: true
}, options);
return tile.add(Ti.UI.createImageView({
image: image,
width: TILE_WIDTH,
height: TILE_WIDTH,
touchEnabled: true
}));
}
};
I tried changing the code to accept the month and year and then added the extra variables to the _ref3 variable, but that didn't work at all.