Did we fix the tracker yet

This commit is contained in:
Alexis Werefox 2021-04-26 18:02:02 +00:00
parent bebc2f84c2
commit 6100a573ab
1 changed files with 13 additions and 7 deletions

View File

@ -3,11 +3,17 @@ import WCard from "../../components/werefox-card";
import { useEffect, useState } from "react";
function getTimes() {
let total_ms = Date.now() - new Date("December 11, 2020 00:00:00");
let days = Math.round(total_ms / 1000 / 60 / 60 / 24);
let hours = (new Date(total_ms).getHours() + 6) % 24;
let minutes = new Date(total_ms).getMinutes();
let seconds = new Date(total_ms).getSeconds();
const total_ms =
Date.now() - new Date("December 11, 2020 00:00:00 GMT-05:00");
const days = Math.floor(total_ms / 1000 / 60 / 60 / 24);
const days_in_ms = days * 1000 * 60 * 60 * 24;
const hours = Math.floor((total_ms - days_in_ms) / 1000 / 60 / 60);
const hours_in_ms = hours * 1000 * 60 * 60;
const minutes = Math.floor((total_ms - days_in_ms - hours_in_ms) / 1000 / 60);
const minutes_in_ms = minutes * 1000 * 60;
const seconds = Math.floor(
(total_ms - days_in_ms - hours_in_ms - minutes_in_ms) / 1000
);
return {
days: `${days} days,`,
hours: `${hours} hours,`,
@ -40,13 +46,13 @@ export default function HRT({ startTimes }) {
card_title="Track my HRT progress!"
>
<WCard>
<p className="text-lg md:text-2xl text-center text-werefox-blue-dark dark:text-werefox-blue">
<p className="pt-6 text-lg md:text-2xl text-center text-werefox-blue-dark dark:text-werefox-blue">
I'm so glad you're interested!!
</p>
<p className="text-lg md:text-2xl text-center text-werefox-blue-dark dark:text-werefox-blue">
I have been on HRT for:
</p>
<div className="text-lg md:text-2xl text-center text-werefox-blue-dark dark:text-werefox-blue grid grid-cols-1 grid-rows-4">
<div className="pb-6 text-lg md:text-2xl text-center text-werefox-blue-dark dark:text-werefox-blue grid grid-cols-1 grid-rows-4">
{Object.keys(timesArray).map((t) => (
<p>{timesArray[t]}</p>
))}