being a wee bit toxic
This commit is contained in:
@@ -12,9 +12,18 @@ function choreItem(chore: FlatasticChore, idToNameMap: Record<number, string>) {
|
|||||||
className = "irregular";
|
className = "irregular";
|
||||||
} else {
|
} else {
|
||||||
className = chore.timeLeftNext <= 0 ? "due" : "notDue";
|
className = chore.timeLeftNext <= 0 ? "due" : "notDue";
|
||||||
|
|
||||||
|
const timeInDays = Math.abs(chore.timeLeftNext) / (60 * 60 * 24) + 1;
|
||||||
|
|
||||||
|
console.log(chore.title, timeInDays);
|
||||||
|
|
||||||
|
const grubers = Math.floor(timeInDays / 100);
|
||||||
|
const days = Math.floor(timeInDays % 100);
|
||||||
|
|
||||||
timeLeftInDays = (
|
timeLeftInDays = (
|
||||||
<span className={style.timeLeft}>
|
<span className={style.timeLeft}>
|
||||||
{Math.abs(Math.floor(chore.timeLeftNext / (60 * 60 * 24)))}d
|
{grubers > 0 && `${grubers} gruber${grubers > 1 ? "s" : ""} `}
|
||||||
|
{days > 0 && `${days} d`}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user