From a1b58a2ff01284f7c4c06473f6c098bedb42b96e Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Fri, 4 Aug 2023 11:34:02 +0000 Subject: [PATCH] Update src/main.js --- src/main.js | 54 ----------------------------------------------------- 1 file changed, 54 deletions(-) diff --git a/src/main.js b/src/main.js index 603c1d90..50202d7e 100644 --- a/src/main.js +++ b/src/main.js @@ -1,57 +1,4 @@ import { createApp } from "vue"; - -import router from "@/router/router.js"; -import App from "./App.vue"; - -import TimeAgo from "javascript-time-ago"; - -import en from "javascript-time-ago/locale/en"; - -TimeAgo.addDefaultLocale(en); - -import { createI18n } from "vue-i18n"; -import enLocale from "@/locales/en.json"; -import "@unocss/reset/tailwind.css"; -import "uno.css"; - -const timeAgo = new TimeAgo("en-US"); - -import("./registerServiceWorker"); - -const mixin = { - methods: { - timeFormat: function (duration) { - var pad = function (num, size) { - return ("000" + num).slice(size * -1); - }; - - var time = parseFloat(duration).toFixed(3), - hours = Math.floor(time / 60 / 60), - minutes = Math.floor(time / 60) % 60, - seconds = Math.floor(time - minutes * 60); - - var str = ""; - - if (hours > 0) str += hours + ":"; - - str += pad(minutes, 2) + ":" + pad(seconds, 2); - - return str; - }, - numberFormat(num) { - var loc = `${this.getPreferenceString("hl")}-${this.getPreferenceString("region")}`; - - try { - Intl.getCanonicalLocales(loc); - } catch { - loc = undefined; - } - - const formatter = Intl.NumberFormat(loc, { - notation: "compact", - }); - return formatter.format(num); - }, addCommas(num) { num = parseInt(num); return num.toLocaleString("en-US"); @@ -531,5 +478,4 @@ window.i18n = i18n; const app = createApp(App); app.use(i18n); app.use(router); -app.mixin(mixin); app.mount("#app");