Implement date formatting on frontend this time
This commit is contained in:
@@ -8,6 +8,17 @@
|
||||
export let nameColor: string;
|
||||
export let dateColor: string;
|
||||
|
||||
let date = new Date(item.date);
|
||||
let dateString = new Intl.DateTimeFormat("en-CA", {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
second: "2-digit",
|
||||
hour12: false,
|
||||
}).format(date);
|
||||
|
||||
let amount: string = item.amount.toString();
|
||||
let per100: string = item.per100?.toString() ?? "";
|
||||
let description: string = item.description ?? "";
|
||||
@@ -55,7 +66,7 @@
|
||||
style="color: {dateColor}"
|
||||
scope="row"
|
||||
>
|
||||
{item.date}
|
||||
{dateString}
|
||||
</th>
|
||||
<td
|
||||
class="px-6 py-4"
|
||||
|
@@ -3,6 +3,17 @@
|
||||
|
||||
export let item: main.Weight;
|
||||
export let dateColor: string;
|
||||
|
||||
let date = new Date(item.date);
|
||||
let dateString = new Intl.DateTimeFormat("en-CA", {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
second: "2-digit",
|
||||
hour12: false,
|
||||
}).format(date);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -12,7 +23,7 @@
|
||||
style="color: {dateColor}"
|
||||
scope="row"
|
||||
>
|
||||
{item.date}
|
||||
{dateString}
|
||||
</th>
|
||||
<td class="px-6 py-4">
|
||||
{item.weight}
|
||||
|
Reference in New Issue
Block a user