Did we fix the tracker yet
This commit is contained in:
parent
bebc2f84c2
commit
6100a573ab
@ -3,11 +3,17 @@ import WCard from "../../components/werefox-card";
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
function getTimes() {
|
function getTimes() {
|
||||||
let total_ms = Date.now() - new Date("December 11, 2020 00:00:00");
|
const total_ms =
|
||||||
let days = Math.round(total_ms / 1000 / 60 / 60 / 24);
|
Date.now() - new Date("December 11, 2020 00:00:00 GMT-05:00");
|
||||||
let hours = (new Date(total_ms).getHours() + 6) % 24;
|
const days = Math.floor(total_ms / 1000 / 60 / 60 / 24);
|
||||||
let minutes = new Date(total_ms).getMinutes();
|
const days_in_ms = days * 1000 * 60 * 60 * 24;
|
||||||
let seconds = new Date(total_ms).getSeconds();
|
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 {
|
return {
|
||||||
days: `${days} days,`,
|
days: `${days} days,`,
|
||||||
hours: `${hours} hours,`,
|
hours: `${hours} hours,`,
|
||||||
@ -40,13 +46,13 @@ export default function HRT({ startTimes }) {
|
|||||||
card_title="Track my HRT progress!"
|
card_title="Track my HRT progress!"
|
||||||
>
|
>
|
||||||
<WCard>
|
<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!!
|
I'm so glad you're interested!!
|
||||||
</p>
|
</p>
|
||||||
<p className="text-lg md:text-2xl text-center text-werefox-blue-dark dark:text-werefox-blue">
|
<p className="text-lg md:text-2xl text-center text-werefox-blue-dark dark:text-werefox-blue">
|
||||||
I have been on HRT for:
|
I have been on HRT for:
|
||||||
</p>
|
</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) => (
|
{Object.keys(timesArray).map((t) => (
|
||||||
<p>{timesArray[t]}</p>
|
<p>{timesArray[t]}</p>
|
||||||
))}
|
))}
|
||||||
|
Loading…
Reference in New Issue
Block a user