var icalendar = require('icalendar');

exports.generateIcal = function(boards) {
    var ical = new icalendar.iCalendar();
    boards.each(function(board) {
        board.cards().each(function(card) {
            // no arm, no chocolate
            if (!card.get('badges').due) return;
            var event = new icalendar.VEvent();
            event.setSummary(card.get('name'));
            event.setDescription(card.get('description'));
            event.setDate(card.get('badges').due);
            ical.addComponent(event);
        });
    });
    return ical;
}

var icalendar = require('icalendar');

exports.generateIcal = function(boards) {
    var ical = new icalendar.iCalendar();
    boards.each(function(board) {
        board.cards().each(function(card) {
            // no arm, no chocolate
            if (!card.get('badges').due) return;
            var event = new icalendar.VEvent();
            event.setSummary(card.get('name'));
            event.setDescription(card.get('description'));
            event.setDate(card.get('badges').due);
            event.addProperty('ATTACH', card.get('url'));
            ical.addComponent(event);
        });
    });
    return ical;
}

Attach the URL to the event.
Attach the URL to the event.

Signed-off-by: François de Metz <5187da0b934cc25eb2201a3ec9206c24b13cb23b@stormz.me>
