Permalink
Browse files

better fast than "right" (wiki events)

  • Loading branch information...
leider committed Dec 7, 2018
1 parent fe9a212 commit 7019a1b4760705d11ff8f5c6b0e04064ebf0aef2
@@ -25,7 +25,7 @@ function contentsToObject(contents, year) {
if (element.trim()) {
const fromAndUntil = misc.compact(element.split('-').map(each => each.trim()));
const from = toDate(fromAndUntil[0], 0);
const until = toDate(fromAndUntil[1] || fromAndUntil[0], 82800000); // 23 hours
const until = toDate(fromAndUntil[1] || fromAndUntil[0], 79200000); // 22 hours
if (from && until) {
return [from.toISOString(), until.toISOString()];
}
@@ -7,7 +7,7 @@ const eventsToObject = require('../../lib/wiki/eventsToObject');
describe('Wiki EventsToObject', () => {
const eventsWithOOP = [{
start: '2015-02-01T00:00:00.000Z',
end: '2015-02-05T23:00:00.000Z',
end: '2015-02-05T22:00:00.000Z',
url: 'http://www.oop-konferenz.de/',
title: 'OOP (München)',
color: '#999'
@@ -74,7 +74,7 @@ describe('Wiki EventsToObject', () => {
describe('parses start and end', () => {
const startString = '2015-02-01T00:00:00.000Z';
const endString = '2015-02-01T23:00:00.000Z';
const endString = '2015-02-01T22:00:00.000Z';
it('when present', () => {
const text = '[OOP](http://www.oop-konferenz.de/) | München | 1.2. - 5.2.';
@@ -37,7 +37,7 @@ describe('Wiki Service - Event Parsing', () => {
wikiService.parseEvents(2018, (err, events) => {
expect(events).to.have.length(4);
expect(events[0].start).to.eql('2018-01-11T00:00:00.000Z');
expect(events[0].end).to.eql('2018-01-11T23:00:00.000Z');
expect(events[0].end).to.eql('2018-01-11T22:00:00.000Z');
done();
});
});

0 comments on commit 7019a1b

Please sign in to comment.