mirror of
https://github.com/clarencechaan/ufc-cal.git
synced 2026-10-19 00: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
@@ -6,6 +6,16 @@ async function createICS() {
|
||||
try {
|
||||
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) => {
|
||||
let date = new Date(parseInt(event.date) * 1000);
|
||||
let start = [
|
||||
@@ -27,6 +37,7 @@ async function createICS() {
|
||||
description +=
|
||||
"\nPrelims\n----------\n" + event.prelims.join("\n") + "\n";
|
||||
description += "\n" + event.url;
|
||||
description += "\n\nAccurate as of " + dateTimestr;
|
||||
let location = event.location;
|
||||
let uid = event.url;
|
||||
let calName = "UFC";
|
||||
|
||||
Reference in new issue
Block a user