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);