Change @luxon imports
parent
4ee0754410
commit
f40354e79a
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
// Public modules from npm
|
// Public modules from npm
|
||||||
import cheerio from "cheerio";
|
import cheerio from "cheerio";
|
||||||
import luxon from "luxon";
|
import { DateTime } from "luxon";
|
||||||
|
|
||||||
// Modules from files
|
// Modules from files
|
||||||
import { urls } from "../../constants/url.js";
|
import { urls } from "../../constants/url.js";
|
||||||
|
@ -180,10 +180,10 @@ export default class PlatformUser {
|
||||||
|
|
||||||
// Parse date
|
// Parse date
|
||||||
const joined = $(MEMBER.JOINED)?.attr("datetime");
|
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");
|
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
|
// Parse donation
|
||||||
const donation = $(MEMBER.AMOUNT_DONATED)?.text().replace("$", "");
|
const donation = $(MEMBER.AMOUNT_DONATED)?.text().replace("$", "");
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
// Public modules from npm
|
// Public modules from npm
|
||||||
import cheerio from "cheerio";
|
import cheerio from "cheerio";
|
||||||
import luxon from "luxon";
|
import { DateTime } from "luxon";
|
||||||
|
|
||||||
// Modules from files
|
// Modules from files
|
||||||
import Post from "./post.js";
|
import Post from "./post.js";
|
||||||
|
@ -265,9 +265,8 @@ export default class Thread {
|
||||||
this._category = JSONLD["articleSection"] as TCategory;
|
this._category = JSONLD["articleSection"] as TCategory;
|
||||||
|
|
||||||
// Validate the dates
|
// Validate the dates
|
||||||
if (luxon.DateTime.fromISO(modified).isValid) this._modified = new Date(modified);
|
if (DateTime.fromISO(modified).isValid) this._modified = new Date(modified);
|
||||||
if (luxon.DateTime.fromISO(published).isValid)
|
if (DateTime.fromISO(published).isValid) this._publication = new Date(published);
|
||||||
this._publication = new Date(published);
|
|
||||||
} else throw htmlResponse.value;
|
} else throw htmlResponse.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue