Skip to content

Commit

Permalink
fix stadium dates
Browse files Browse the repository at this point in the history
  • Loading branch information
Yousef Alam committed Apr 29, 2023
1 parent 0350652 commit 950fb43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"calendar"
],
"dependencies": {
"x-ray": "^2.3.2",
"ical-generator": "^0.2.9"
"ical-generator": "^0.2.9",
"moment": "^2.29.4",
"x-ray": "^2.3.2"
}
}
5 changes: 3 additions & 2 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
var Xray = require('x-ray');
var xray = Xray();
var ical = require('ical-generator');
var moment = require('moment')

var sourceUrl = "https://www.wembleystadium.com/events";

xray(sourceUrl, {
pageTitle: 'title',
events: xray('div.fa-filter-content__item', [{
title: 'h2',
date: 'span.small-text',
date: 'div.align-left > span.small-text',
description: 'p',
longDescription: 'p',
}])
Expand All @@ -18,7 +19,7 @@ xray(sourceUrl, {
var events = [];
for (var i = 0; i < content.events.length; i++) {
var eDateString = content.events[i].date;
var eDate = new Date(eDateString[0]);
var eDate = moment(eDateString, 'DD MMM YYYY').toDate();
var event = {
start: eDate,
// allDay: true,
Expand Down

0 comments on commit 950fb43

Please sign in to comment.