Prevent time travel
This commit is contained in:
parent
f1ea3791ba
commit
293cfd74a1
2 changed files with 5 additions and 1 deletions
|
@ -74,7 +74,8 @@ export async function updateConfiguration(data: Configuration) {
|
||||||
|
|
||||||
export async function fetchBrewingEvents(): Promise<BrewingEvent[]> {
|
export async function fetchBrewingEvents(): Promise<BrewingEvent[]> {
|
||||||
const result = await api.get("brewing-events").json<WireBrewingEvent[]>()
|
const result = await api.get("brewing-events").json<WireBrewingEvent[]>()
|
||||||
return result.map(e => ({
|
|
||||||
|
return result.sort((a, b) => a.steeping_tested_time.localeCompare(b.steeping_tested_time)).map(e => ({
|
||||||
id: e.change_id,
|
id: e.change_id,
|
||||||
typeOfTeaId: e.tea_id.toString(),
|
typeOfTeaId: e.tea_id.toString(),
|
||||||
timestamp: Temporal.PlainDateTime.from(e.steeping_tested_time).toZonedDateTime("UTC").toInstant()
|
timestamp: Temporal.PlainDateTime.from(e.steeping_tested_time).toZonedDateTime("UTC").toInstant()
|
||||||
|
|
|
@ -93,6 +93,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(props.brewingEvents)
|
||||||
|
console.log(props.brewingEvents.filter(e => e.typeOfTeaId === "9").map(e => e.timestamp.toJSON()))
|
||||||
|
|
||||||
const chartData = computed<ChartData<"line">>(() => ({
|
const chartData = computed<ChartData<"line">>(() => ({
|
||||||
datasets: [
|
datasets: [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue