diff --git a/src/scripts/classes/mapping/platform-user.ts b/src/scripts/classes/mapping/platform-user.ts index f14a3b2..0be0c81 100644 --- a/src/scripts/classes/mapping/platform-user.ts +++ b/src/scripts/classes/mapping/platform-user.ts @@ -7,7 +7,7 @@ // Public modules from npm import cheerio from "cheerio"; -import luxon from "luxon"; +import { DateTime } from "luxon"; // Modules from files import { urls } from "../../constants/url.js"; @@ -180,10 +180,10 @@ export default class PlatformUser { // Parse date const joined = $(MEMBER.JOINED)?.attr("datetime"); - if (luxon.DateTime.fromISO(joined).isValid) this._joined = new Date(joined); + if (DateTime.fromISO(joined).isValid) this._joined = new Date(joined); const lastSeen = $(MEMBER.LAST_SEEN)?.attr("datetime"); - if (luxon.DateTime.fromISO(lastSeen).isValid) this._joined = new Date(lastSeen); + if (DateTime.fromISO(lastSeen).isValid) this._joined = new Date(lastSeen); // Parse donation const donation = $(MEMBER.AMOUNT_DONATED)?.text().replace("$", ""); diff --git a/src/scripts/classes/mapping/thread.ts b/src/scripts/classes/mapping/thread.ts index ed532dd..9923203 100644 --- a/src/scripts/classes/mapping/thread.ts +++ b/src/scripts/classes/mapping/thread.ts @@ -7,7 +7,7 @@ // Public modules from npm import cheerio from "cheerio"; -import luxon from "luxon"; +import { DateTime } from "luxon"; // Modules from files import Post from "./post.js"; @@ -265,9 +265,8 @@ export default class Thread { this._category = JSONLD["articleSection"] as TCategory; // Validate the dates - if (luxon.DateTime.fromISO(modified).isValid) this._modified = new Date(modified); - if (luxon.DateTime.fromISO(published).isValid) - this._publication = new Date(published); + if (DateTime.fromISO(modified).isValid) this._modified = new Date(modified); + if (DateTime.fromISO(published).isValid) this._publication = new Date(published); } else throw htmlResponse.value; }