Fix errors for first of month.
Some checks failed
Build power-consumtion image / Build-and-release-image (push) Failing after 2m33s
Some checks failed
Build power-consumtion image / Build-and-release-image (push) Failing after 2m33s
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user