diff --git a/astro.config.mjs b/astro.config.mjs index 2ff3bdc..aa82e58 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,5 +1,4 @@ import { defineConfig } from 'astro/config'; - import vue from "@astrojs/vue"; // https://astro.build/config diff --git a/package.json b/package.json index c3fcbd8..5babf01 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,13 @@ "private": true, "scripts": { "dev": "astro dev", - "start": "astro dev", + "start": "deno run --allow-net --allow-read --allow-env ./dist/server/entry.mjs", "build": "astro build", "preview": "astro preview", "astro": "astro" }, "dependencies": { + "@astrojs/deno": "1.1.0", "@astrojs/vue": "1.1.0", "astro": "^1.4.2", "vue": "^3.2.30" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3726cda..b2a66ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,12 +1,14 @@ lockfileVersion: 5.4 specifiers: + '@astrojs/deno': 1.1.0 '@astrojs/vue': 1.1.0 astro: ^1.4.2 sass: 1.55.0 vue: ^3.2.30 dependencies: + '@astrojs/deno': 1.1.0 '@astrojs/vue': 1.1.0_whxeo4miwfmfgowxp5hpxvmcbm astro: 1.4.2_sass@1.55.0 vue: 3.2.40 @@ -32,6 +34,12 @@ packages: resolution: {integrity: sha512-GE7uLvH7rSHuTHdMun+867TWsgYNYsaGuhvXsywcaabl4W4n/3b1kzgzrIsrXYBo51J0k6qD33mVdsHdvwv5rw==} dev: false + /@astrojs/deno/1.1.0: + resolution: {integrity: sha512-oPjKmQQkLZPD3tl+Mur86SguTPlOYwASByAmRWAGOesmHgktTHebuJprc2dvqfmbao6mZbToZPLm63IqdJqlRg==} + dependencies: + esbuild: 0.14.54 + dev: false + /@astrojs/language-server/0.26.2: resolution: {integrity: sha512-9nkfdd6CMXLDIJojnwbYu5XrYfOI+g63JlktOlpFCwFjFNpm1u0e/+pXXmj6Zs+PkSTo0kV1UM77dRKRS5OC1Q==} hasBin: true diff --git a/src/components/TimeFormat.vue b/src/components/TimeFormat.vue new file mode 100644 index 0000000..c17f10c --- /dev/null +++ b/src/components/TimeFormat.vue @@ -0,0 +1,40 @@ + + + \ No newline at end of file diff --git a/src/components/UnixTime.vue b/src/components/UnixTime.vue new file mode 100644 index 0000000..2c258e1 --- /dev/null +++ b/src/components/UnixTime.vue @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/src/pages/utilities/time.astro b/src/pages/utilities/time.astro index 07c6ad5..f50dc4f 100644 --- a/src/pages/utilities/time.astro +++ b/src/pages/utilities/time.astro @@ -3,8 +3,9 @@ import NavBar from "../../components/NavBar.astro"; import TimeZone from "../../components/TimeZone.vue"; import Layout from "../../layouts/Layout.astro"; +import TimeFormat from "../../components/TimeFormat.vue"; +import UnixTime from "../../components/UnixTime.vue"; -const crntTime = Date.now(); const navLinks = [ { img: { @@ -25,124 +26,53 @@ const navLinks = [ ]; --- - +

Time Utilities

Your current timezone:

-

The current time in Unix Epoch: { Math.floor(crntTime / 1000) }
or {crntTime} in Unix millis

+ +

To format the time for Discord, you can use:
- - { `` } - - - to get - { - Intl.DateTimeFormat(Intl.Locale, { + + }, {hour: '2-digit', minute: '2-digit'}]} dFormat="f" client:load />
- - { `` } - - - to get - { - Intl.DateTimeFormat(Intl.Locale, { + +
+
+ }]} dFormat="t" client:load />
- - { `` } - - - to get - - { - Intl.DateTimeFormat(Intl.Locale, { - hour: '2-digit', - minute: '2-digit', - }).format(crntTime) - } -
- - { `` } - - - to get - - { - Intl.DateTimeFormat(Intl.Locale, { + + }]} dFormat="T" client:load />
- - { `` } - - - to get - - { - Intl.DateTimeFormat(Intl.Locale, { + + }]} dFormat="d" client:load />
- - { `` } - - - to get - - { - Intl.DateTimeFormat(Intl.Locale, { + + }]} dFormat="D" client:load />

\ No newline at end of file