diff --git a/public/index.php b/public/index.php index cb8f10b..90b65d5 100644 --- a/public/index.php +++ b/public/index.php @@ -21,7 +21,8 @@ if (isset($_POST['action']) && $_POST['action'] == 'set_values') { $actual = new DateTime(); $dates = get_month($local_db, $table_aggregation); -$chosen_date = (isset($_POST['date'])) ? $_POST['date'] : $actual->format('Y-m'); +$chosen_date = (isset($_POST['date'])) ? $_POST['date'] : $actual->modify('-1 day')->format('Y-m'); + $data = get_aggregation($local_db, $table_aggregation, $chosen_date); $month_values = get_month_aggregation($local_db, $table_aggregation, $chosen_date); $year_values = get_year_aggregation($local_db, $table_aggregation, $chosen_date); diff --git a/public/production.php b/public/production.php index 3f5c154..ccd2832 100644 --- a/public/production.php +++ b/public/production.php @@ -32,7 +32,7 @@ if (isset($_POST['action']) && $_POST['action'] == 'set_values') { $actual = new DateTime(); $dates = get_month($local_db, $table_aggregation); -$chosen_date = (isset($_POST['date'])) ? $_POST['date'] : $actual->format('Y-m'); +$chosen_date = (isset($_POST['date'])) ? $_POST['date'] : $actual->modify('-1 day')->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);