diff --git a/thrimbletrimmer/package.json b/thrimbletrimmer/package.json index cec134e..c480e23 100644 --- a/thrimbletrimmer/package.json +++ b/thrimbletrimmer/package.json @@ -16,9 +16,11 @@ "typescript": "5.6.3", "url": "0.11.4", "vite": "5.4.10", - "vite-plugin-solid": "2.10.2" + "vite-plugin-solid": "2.10.2", + "@types/luxon": "3.4.2" }, "dependencies": { + "luxon": "3.4.4", "solid-js": "1.9.3" } } diff --git a/thrimbletrimmer/src/common/convertTime.tsx b/thrimbletrimmer/src/common/convertTime.tsx index 1538e3d..5b0785b 100644 --- a/thrimbletrimmer/src/common/convertTime.tsx +++ b/thrimbletrimmer/src/common/convertTime.tsx @@ -1,5 +1,4 @@ -import { l } from "vite/dist/node/types.d-aGj9QkWt"; -import { DateTime } from "../external/luxon.min"; +import { DateTime } from "luxon"; export function dateTimeFromWubloaderTime(wubloaderTime: string): DateTime | null { const dt = DateTime.fromISO(wubloaderTime, { zone: "UTC" }); @@ -86,7 +85,7 @@ export function timeAgoFromDateTime(dateTime: DateTime): string { timeAgoSeconds = -timeAgoSeconds; } - const seconds = (((timeAgoSeconds % 60) * 1000) | 0) / 1000 + const seconds = (((timeAgoSeconds % 60) * 1000) | 0) / 1000; const secondsString = seconds < 10 ? `0${seconds}` : seconds.toString(); const minutes = (timeAgoSeconds / 60) % 60 | 0; const minutesString = minutes < 10 ? `0${minutes}` : minutes.toString(); diff --git a/thrimbletrimmer/src/common/googleAuth.tsx b/thrimbletrimmer/src/common/googleAuth.tsx index a5d4e02..0abba77 100644 --- a/thrimbletrimmer/src/common/googleAuth.tsx +++ b/thrimbletrimmer/src/common/googleAuth.tsx @@ -20,7 +20,7 @@ async function googleSignOut() { if (googleUser) { googleUser = null; await gapi.auth2.getAuthInstance().signOut(); - + const signInElem = document.getElementById("google-auth-sign-in"); if (signInElem) { signInElem.classList.add("hidden"); @@ -40,7 +40,9 @@ export const GoogleSignIn: Component = () => { return (
); -}; \ No newline at end of file +}; diff --git a/thrimbletrimmer/src/external/luxon.min.js b/thrimbletrimmer/src/external/luxon.min.js deleted file mode 100644 index 9a7d762..0000000 --- a/thrimbletrimmer/src/external/luxon.min.js +++ /dev/null @@ -1 +0,0 @@ -class e extends Error{}class L extends e{constructor(e){super("Invalid DateTime: "+e.toMessage())}}class z extends e{constructor(e){super("Invalid Interval: "+e.toMessage())}}class j extends e{constructor(e){super("Invalid Duration: "+e.toMessage())}}class v extends e{}class q extends e{constructor(e){super("Invalid unit "+e)}}class u extends e{}class r extends e{constructor(){super("Zone is an abstract class")}}var t="numeric",n="short",s="long";const A={year:t,month:t,day:t},$={year:t,month:n,day:t},U={year:t,month:n,day:t,weekday:n},_={year:t,month:s,day:t},Y={year:t,month:s,day:t,weekday:s},R={hour:t,minute:t},H={hour:t,minute:t,second:t},P={hour:t,minute:t,second:t,timeZoneName:n},J={hour:t,minute:t,second:t,timeZoneName:s},G={hour:t,minute:t,hourCycle:"h23"},B={hour:t,minute:t,second:t,hourCycle:"h23"},Q={hour:t,minute:t,second:t,hourCycle:"h23",timeZoneName:n},K={hour:t,minute:t,second:t,hourCycle:"h23",timeZoneName:s},X={year:t,month:t,day:t,hour:t,minute:t},ee={year:t,month:t,day:t,hour:t,minute:t,second:t},te={year:t,month:n,day:t,hour:t,minute:t},re={year:t,month:n,day:t,hour:t,minute:t,second:t},ne={year:t,month:n,day:t,weekday:n,hour:t,minute:t},se={year:t,month:s,day:t,hour:t,minute:t,timeZoneName:n},ie={year:t,month:s,day:t,hour:t,minute:t,second:t,timeZoneName:n},ae={year:t,month:s,day:t,weekday:s,hour:t,minute:t,timeZoneName:s},oe={year:t,month:s,day:t,weekday:s,hour:t,minute:t,second:t,timeZoneName:s};class i{get type(){throw new r}get name(){throw new r}get ianaName(){return this.name}get isUniversal(){throw new r}offsetName(e,t){throw new r}formatOffset(e,t){throw new r}offset(e){throw new r}equals(e){throw new r}get isValid(){throw new r}}let ue=null;class le extends i{static get instance(){return ue=null===ue?new le:ue}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return It(e,t,r)}formatOffset(e,t){return Ct(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}let ce={};function he(e){return ce[e]||(ce[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ce[e]}const de={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function me(e,t){var e=e.format(t).replace(/\u200E/g,""),[,t,e,r,n,s,i,a]=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(e);return[r,t,e,n,s,i,a]}function fe(e,t){var r=e.formatToParts(t),n=[];for(let e=0;e