🐛 Fix date

This commit is contained in:
Freeze455
2021-09-05 10:15:42 +02:00
parent 2c2d3a9153
commit 63006a7792
5 changed files with 80 additions and 430 deletions

View File

@@ -34,7 +34,7 @@
<h2 class="text-3xl font-extrabold dark:text-white" id="join-heading">Join us on discord</h2>
<p class="text-lg dark:text-white">Varius facilisi mauris sed sit. Non sed et duis dui leo, vulputate id malesuada non. Cras aliquet purus dui laoreet diam sed lacus, fames.</p>
<LinkExternal
href="https://discord.gg/tQebEww8zG"
url="https://discord.gg/tQebEww8zG"
class="block w-full py-3 px-5 text-center dark:bg-gray-600 border border-transparent rounded-md shadow-md text-base font-medium text-gray-700 hover:bg-gray-50 dark:text-white sm:inline-block sm:w-auto">
Explore open positions
</LinkExternal>

View File

@@ -46,6 +46,7 @@
<script setup lang="ts">
import { reactive } from 'vue'
import axios from 'axios'
import { DateTime } from 'luxon'
const state = reactive({
userCount: 0,
@@ -54,9 +55,9 @@ const state = reactive({
})
async function getData () {
const day = new Date()
const { data: users } = await axios.get(`https://api.npmjs.org/downloads/point/2020-01-01:${day.getFullYear()}-${day.getUTCMonth()}-${day.getUTCDay()}/@discord-factory/command`)
const { data: projects } = await axios.get(`https://api.npmjs.org/downloads/point/2020-01-01:${day.getFullYear()}-${day.getUTCMonth()}-${day.getUTCDay()}/@discord-factory/core`)
const now = DateTime.now().toFormat('yyyy-MM-dd')
const { data: users } = await axios.get(`https://api.npmjs.org/downloads/point/2020-01-01:${now}/@discord-factory/command`)
const { data: projects } = await axios.get(`https://api.npmjs.org/downloads/point/2020-01-01:${now}/@discord-factory/core`)
const { data: discord } = await axios.get('https://discord.com/api/guilds/874056537444859984/widget.json')
state.userCount = users.downloads