mirror of
https://github.com/clarencechaan/ufc-cal.git
synced 2026-10-19 08:38:30 -07:00
Include date and time of last scrape in event description
This commit is contained in:
1 parent
48b5285600
commit
0ea89eb1c4
2 files changed
+12
-1
No files matched your search
@@ -3,7 +3,7 @@ name: GitHub Self-Updating Repository
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "37 */4 * * *"
|
- cron: "0 */4 * * *"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
report:
|
report:
|
||||||
|
|||||||
@@ -6,6 +6,16 @@ async function createICS() {
|
|||||||
try {
|
try {
|
||||||
let events = await getAllDetailedEvents();
|
let events = await getAllDetailedEvents();
|
||||||
|
|
||||||
|
let currentDateTime = new Date();
|
||||||
|
let dateTimestr = currentDateTime.toLocaleString("en-US", {
|
||||||
|
month: "short",
|
||||||
|
day: "numeric",
|
||||||
|
hour: "numeric",
|
||||||
|
minute: "numeric",
|
||||||
|
timeZone: "America/Toronto",
|
||||||
|
timeZoneName: "short",
|
||||||
|
});
|
||||||
|
|
||||||
events = events.map((event) => {
|
events = events.map((event) => {
|
||||||
let date = new Date(parseInt(event.date) * 1000);
|
let date = new Date(parseInt(event.date) * 1000);
|
||||||
let start = [
|
let start = [
|
||||||
@@ -27,6 +37,7 @@ async function createICS() {
|
|||||||
description +=
|
description +=
|
||||||
"\nPrelims\n----------\n" + event.prelims.join("\n") + "\n";
|
"\nPrelims\n----------\n" + event.prelims.join("\n") + "\n";
|
||||||
description += "\n" + event.url;
|
description += "\n" + event.url;
|
||||||
|
description += "\n\nAccurate as of " + dateTimestr;
|
||||||
let location = event.location;
|
let location = event.location;
|
||||||
let uid = event.url;
|
let uid = event.url;
|
||||||
let calName = "UFC";
|
let calName = "UFC";
|
||||||
|
|||||||
Reference in new issue
Block a user