Compare commits
2 Commits
2.3.0
...
bee45ebc59
| Author | SHA1 | Date | |
|---|---|---|---|
| bee45ebc59 | |||
| 2025f450e6 |
5
food.ddl
5
food.ddl
@@ -2,7 +2,7 @@ begin;
|
|||||||
|
|
||||||
create table weight (
|
create table weight (
|
||||||
id integer primary key,
|
id integer primary key,
|
||||||
date datetime default (datetime('now', '+2 hours')),
|
date datetime default (datetime('now')),
|
||||||
weight real not null
|
weight real not null
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ order by date desc;
|
|||||||
|
|
||||||
create table food(
|
create table food(
|
||||||
id integer primary key,
|
id integer primary key,
|
||||||
date datetime default (datetime('now', '+2 hours')),
|
date datetime default (datetime('now')),
|
||||||
food varchar not null,
|
food varchar not null,
|
||||||
description varchar,
|
description varchar,
|
||||||
amount real not null,
|
amount real not null,
|
||||||
@@ -100,7 +100,6 @@ where word = old.food
|
|||||||
and rank <= 0;
|
and rank <= 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
drop trigger if exists food_foodfix_update;
|
drop trigger if exists food_foodfix_update;
|
||||||
create trigger food_foodfix_update AFTER
|
create trigger food_foodfix_update AFTER
|
||||||
update on food for EACH row
|
update on food for EACH row
|
||||||
|
|||||||
@@ -8,6 +8,17 @@
|
|||||||
export let nameColor: string;
|
export let nameColor: string;
|
||||||
export let dateColor: 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 amount: string = item.amount.toString();
|
||||||
let per100: string = item.per100?.toString() ?? "";
|
let per100: string = item.per100?.toString() ?? "";
|
||||||
let description: string = item.description ?? "";
|
let description: string = item.description ?? "";
|
||||||
@@ -55,7 +66,7 @@
|
|||||||
style="color: {dateColor}"
|
style="color: {dateColor}"
|
||||||
scope="row"
|
scope="row"
|
||||||
>
|
>
|
||||||
{item.date}
|
{dateString}
|
||||||
</th>
|
</th>
|
||||||
<td
|
<td
|
||||||
class="px-6 py-4"
|
class="px-6 py-4"
|
||||||
|
|||||||
@@ -3,6 +3,17 @@
|
|||||||
|
|
||||||
export let item: main.Weight;
|
export let item: main.Weight;
|
||||||
export let dateColor: 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);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -12,7 +23,7 @@
|
|||||||
style="color: {dateColor}"
|
style="color: {dateColor}"
|
||||||
scope="row"
|
scope="row"
|
||||||
>
|
>
|
||||||
{item.date}
|
{dateString}
|
||||||
</th>
|
</th>
|
||||||
<td class="px-6 py-4">
|
<td class="px-6 py-4">
|
||||||
{item.weight}
|
{item.weight}
|
||||||
|
|||||||
Reference in New Issue
Block a user