summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/components/boards/boardBody.jade4
-rw-r--r--client/components/boards/boardBody.js24
2 files changed, 26 insertions, 2 deletions
diff --git a/client/components/boards/boardBody.jade b/client/components/boards/boardBody.jade
index 0a454e92..9e4b9c61 100644
--- a/client/components/boards/boardBody.jade
+++ b/client/components/boards/boardBody.jade
@@ -29,7 +29,7 @@ template(name="boardBody")
+calendarView
template(name="calendarView")
- .swimlane.list-group.js-lists
+ .calendar-view.swimlane
if currentCard
+cardDetails(currentCard)
- +fullcalendar
+ +fullcalendar(calendarOptions)
diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js
index 911b0120..1308c280 100644
--- a/client/components/boards/boardBody.js
+++ b/client/components/boards/boardBody.js
@@ -150,4 +150,28 @@ BlazeComponent.extendComponent({
onRendered() {
},
+ calendarOptions() {
+ return {
+ id: 'calendar-view',
+ defaultView: 'basicWeek',
+ events(start, end, timezone, callback) {
+ const currentBoard = Boards.findOne(Session.get('currentBoard'));
+ const events = [];
+ currentBoard.cardsInInterval(start.toDate(), end.toDate()).forEach(function(card){
+ events.push({
+ id: card.id,
+ title: card.title,
+ start: card.startAt,
+ end: card.endAt,
+ url: FlowRouter.url('card', {
+ boardId: currentBoard._id,
+ slug: currentBoard.slug,
+ cardId: card._id,
+ }),
+ });
+ });
+ callback(events);
+ },
+ };
+ },
}).register('calendarView');