interlude/schedule.js

146 lines
4.2 KiB
JavaScript
Raw Permalink Normal View History

2014-05-13 07:27:47 +03:00
function Schedule() {
var events = [];
this.addEvent = function(event) {
events.push(event);
events = _.sortBy(events, function(event) {
return event.startTime.unix()
});
}
this.upcomingEvents = function() {
return _.select(events, function(event) {
return event.startTime.isAfter(moment());
});
}
this.nextEvent = function() {
return _.first(this.upcomingEvents());
}
2014-06-21 05:08:15 +03:00
this.currentEvent = function() {
2014-06-21 10:55:38 +03:00
var latestEvent = _.last(this.pastEvents());
2014-06-21 05:08:15 +03:00
var nextEvent = this.nextEvent();
2014-08-20 14:36:12 +03:00
if (typeof nextEvent != 'undefined' && moment(nextEvent.startTime).subtract('minutes', 10).isAfter(moment())) {
2014-06-21 10:55:38 +03:00
return latestEvent;
} else {
return undefined;
}
2014-06-21 05:08:15 +03:00
}
2014-05-13 15:43:58 +03:00
this.futureEvents = function() {
return this.upcomingEvents().splice(1);
}
this.pastEvents = function() {
return _.select(events, function(event) {
return event.startTime.isBefore(moment());
});
}
this.allEvents = function() {
2014-05-13 07:27:47 +03:00
return events;
}
this.addDelay = function(time) {
_.each(this.upcomingEvents(), function(event, index, agenda) {
event.startTime.add(time);
});
}
}
var schedule = new Schedule();
2014-06-21 04:28:41 +03:00
schedule.addEvent({
2014-08-24 08:58:07 +03:00
title: 'Behind the scenes of a grown-up web application',
2014-08-23 09:48:32 +03:00
startTime: moment({hour: 10, minute: 00}),
speakers: [
{
2014-08-24 08:58:07 +03:00
name: 'Kerstin Puschke (titanoboa)',
description: 'Kerstin Puschke is a software engineer living in Hamburg. As part of an awesome team, she contributes to the backend of XING, a social network for business professionals with about 14 million users.'
2014-08-23 09:48:32 +03:00
}
]
2014-06-21 04:28:41 +03:00
});
2014-05-13 07:27:47 +03:00
schedule.addEvent({
2014-08-24 08:58:07 +03:00
title: 'GOTO statement considered awesome',
startTime: moment({hour: 10, minute: 30}),
2014-08-23 09:48:32 +03:00
speakers: [
{
2014-08-24 08:58:07 +03:00
name: 'Carl Mäsak (masak)',
description: 'Has been programming Perl since 2001. Found Perl 6 somewhere around 2004, and fell in love. Now doing a number of projects in Perl 5 and 6. A regular at #perl6, he often helps newcomers and does smallish tasks on the Perl 6 specs, test suite and on Rakudo and Niecza.'
2014-08-23 09:48:32 +03:00
}
]
2014-05-13 07:27:47 +03:00
});
schedule.addEvent({
2014-08-24 08:58:07 +03:00
title: 'C-Day Is Coming',
startTime: moment({hour: 11}),
2014-07-10 13:25:55 +03:00
speakers: [
{
2014-08-24 08:58:07 +03:00
name: 'liz',
description: 'Made some interesting modules, to be found at CPAN. Co-organiser YAPC::Europe::2001 in Amsterdam. Chairman of YAPC::Europe::Foundation (YEF)'
2014-07-10 13:25:55 +03:00
}
]
2014-05-13 07:27:47 +03:00
});
schedule.addEvent({
2014-08-22 12:50:59 +03:00
title: 'Lunch',
2014-08-20 14:16:53 +03:00
startTime: moment({hour: 12, minute: 20})
2014-05-13 07:27:47 +03:00
});
2014-06-21 12:13:55 +03:00
schedule.addEvent({
2014-08-24 08:58:07 +03:00
title: 'Digest:SHA is broken',
2014-08-20 14:16:53 +03:00
startTime: moment({hour: 13, minute: 20}),
2014-07-10 13:25:55 +03:00
speakers: [
{
2014-08-24 08:58:07 +03:00
name: 'Mark Overmeer (markov)',
description: 'Perl, Perl and UNIX'
2014-07-10 13:25:55 +03:00
}
]
2014-06-21 12:13:55 +03:00
});
2014-08-24 08:58:07 +03:00
2014-05-13 07:27:47 +03:00
schedule.addEvent({
2014-08-24 08:58:07 +03:00
title: 'Asynchronous Programming with Futures',
2014-08-20 14:16:53 +03:00
startTime: moment({hour: 13, minute: 50}),
2014-07-10 13:25:55 +03:00
speakers: [
{
2014-08-24 08:58:07 +03:00
name: 'Paul Evans (LeoNerd)',
2014-08-23 09:48:32 +03:00
description: ''
2014-07-10 13:25:55 +03:00
}
]
2014-05-13 07:27:47 +03:00
});
schedule.addEvent({
2014-08-24 08:58:07 +03:00
title: 'Adventures in Perl 6 Asynchrony',
2014-08-20 14:16:53 +03:00
startTime: moment({hour: 14, minute: 50}),
2014-07-10 13:25:55 +03:00
speakers: [
{
2014-08-24 08:58:07 +03:00
name: 'Jonathan Worthington (jnthn)',
description: 'In the Perl world, Jonathan is best known as one of the key developers of the Rakudo Perl 6 compiler. His work has focused on the object model, type system, multiple dispatch and signatures. He\'s a regular speaker in the European Perl Conference and Workshop scene, and finds any invite to come and speak and enjoy a few beers with the local Perl hackers hard to resist.'
2014-07-10 13:25:55 +03:00
}
]
2014-05-13 07:27:47 +03:00
});
schedule.addEvent({
2014-08-23 09:48:32 +03:00
title: 'Coffee Break',
2014-08-20 14:16:53 +03:00
startTime: moment({hour: 15, minute: 40})
2014-05-13 07:27:47 +03:00
});
schedule.addEvent({
2014-08-24 08:58:07 +03:00
title: 'Day 3 Keynote - The Joy In What We Do',
2014-08-20 14:16:53 +03:00
startTime: moment({hour: 16, minute: 10}),
2014-07-10 13:25:55 +03:00
speakers: [
{
2014-08-24 08:58:07 +03:00
name: 'Sawyer X',
2014-08-23 09:48:32 +03:00
description: ''
2014-07-10 13:25:55 +03:00
}
]
2014-05-13 07:27:47 +03:00
});
2014-08-24 08:58:07 +03:00
schedule.addEvent({
title: 'Lightning Talks',
startTime: moment({hour: 17, minute: 00}),
});