diff --git a/src/backend.ts b/src/backend.ts index ab374f1..20a926e 100644 --- a/src/backend.ts +++ b/src/backend.ts @@ -74,7 +74,8 @@ export async function updateConfiguration(data: Configuration) { export async function fetchBrewingEvents(): Promise { const result = await api.get("brewing-events").json() - 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() diff --git a/src/components/charts/TeaConsumptionOverTimeChart.vue b/src/components/charts/TeaConsumptionOverTimeChart.vue index 98772e5..81703c9 100644 --- a/src/components/charts/TeaConsumptionOverTimeChart.vue +++ b/src/components/charts/TeaConsumptionOverTimeChart.vue @@ -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>(() => ({ datasets: [ {