From 4cb13ebc858d61e53732b2a89f237dbf7369e0ab Mon Sep 17 00:00:00 2001 From: Christian Steinle Date: Mon, 31 Mar 2025 09:51:18 +0200 Subject: [PATCH] Fix production view for initial display. --- public/production.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/production.php b/public/production.php index 7395fb3..3f5c154 100644 --- a/public/production.php +++ b/public/production.php @@ -30,8 +30,9 @@ if (isset($_POST['action']) && $_POST['action'] == 'set_values') { $local_db->query($query); } +$actual = new DateTime(); $dates = get_month($local_db, $table_aggregation); -$chosen_date = (isset($_POST['date'])) ? $_POST['date'] : $dates[0]; +$chosen_date = (isset($_POST['date'])) ? $_POST['date'] : $actual->format('Y-m'); $production_values = get_production_values_for_month($local_db, $table_aggregation, $chosen_date); $month_production = get_month_production($local_db, $table_production, $chosen_date);