Fix set data inizio/fine periodo

This commit is contained in:
MatteoPistorello 2022-05-31 17:56:54 +02:00
parent fa23161def
commit 68e4169db5
1 changed files with 4 additions and 2 deletions

View File

@ -20,6 +20,8 @@
$skip_permissions = true; $skip_permissions = true;
include_once __DIR__.'/core.php'; include_once __DIR__.'/core.php';
use Carbon\Carbon;
$op = filter('op'); $op = filter('op');
// LOGIN // LOGIN
@ -32,13 +34,13 @@ switch ($op) {
$_SESSION['keep_alive'] = true; $_SESSION['keep_alive'] = true;
if (intval(setting('Inizio periodo calendario'))) { if (intval(setting('Inizio periodo calendario'))) {
$_SESSION['period_start'] = setting('Inizio periodo calendario'); $_SESSION['period_start'] = Carbon::createFromFormat('d/m/Y', setting('Inizio periodo calendario'))->format('Y-m-d');
} else { } else {
$_SESSION['period_start'] = date('Y').'-01-01'; $_SESSION['period_start'] = date('Y').'-01-01';
} }
if (intval(setting('Fine periodo calendario'))) { if (intval(setting('Fine periodo calendario'))) {
$_SESSION['period_end'] = setting('Fine periodo calendario'); $_SESSION['period_end'] = Carbon::createFromFormat('d/m/Y', setting('Fine periodo calendario'))->format('Y-m-d');
} else { } else {
$_SESSION['period_end'] = date('Y').'-12-31'; $_SESSION['period_end'] = date('Y').'-12-31';
} }