Prevent time travel

This commit is contained in:
Moritz Ruth 2024-06-17 15:40:10 +02:00
parent f1ea3791ba
commit 293cfd74a1
Signed by: moritzruth
GPG key ID: C9BBAB79405EE56D
2 changed files with 5 additions and 1 deletions

View file

@ -74,7 +74,8 @@ export async function updateConfiguration(data: Configuration) {
export async function fetchBrewingEvents(): Promise<BrewingEvent[]> {
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,
typeOfTeaId: e.tea_id.toString(),
timestamp: Temporal.PlainDateTime.from(e.steeping_tested_time).toZonedDateTime("UTC").toInstant()

View file

@ -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">>(() => ({
datasets: [
{