Skip to content

Commit

Permalink
Fix mindate & maxdate for showDateTimeField
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmr authored and cedric-anne committed Oct 24, 2024
1 parent bdde592 commit ce4fb61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
24 changes: 0 additions & 24 deletions .phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -2251,30 +2251,6 @@
'count' => 2,
'path' => __DIR__ . '/src/Html.php',
];
$ignoreErrors[] = [
// identifier: offsetAccess.notFound
'message' => '#^Offset \'max\' does not exist on array\\{value\\: mixed, maybeempty\\: mixed, canedit\\: mixed, mindate\\: mixed, maxdate\\: mixed, mintime\\: mixed, maxtime\\: mixed, timestep\\: mixed, \\.\\.\\.\\}\\.$#',
'count' => 1,
'path' => __DIR__ . '/src/Html.php',
];
$ignoreErrors[] = [
// identifier: empty.offset
'message' => '#^Offset \'max\' on array\\{value\\: mixed, maybeempty\\: mixed, canedit\\: mixed, mindate\\: mixed, maxdate\\: mixed, mintime\\: mixed, maxtime\\: mixed, timestep\\: mixed, \\.\\.\\.\\} in empty\\(\\) does not exist\\.$#',
'count' => 1,
'path' => __DIR__ . '/src/Html.php',
];
$ignoreErrors[] = [
// identifier: offsetAccess.notFound
'message' => '#^Offset \'min\' does not exist on array\\{value\\: mixed, maybeempty\\: mixed, canedit\\: mixed, mindate\\: mixed, maxdate\\: mixed, mintime\\: mixed, maxtime\\: mixed, timestep\\: mixed, \\.\\.\\.\\}\\.$#',
'count' => 1,
'path' => __DIR__ . '/src/Html.php',
];
$ignoreErrors[] = [
// identifier: empty.offset
'message' => '#^Offset \'min\' on array\\{value\\: mixed, maybeempty\\: mixed, canedit\\: mixed, mindate\\: mixed, maxdate\\: mixed, mintime\\: mixed, maxtime\\: mixed, timestep\\: mixed, \\.\\.\\.\\} in empty\\(\\) does not exist\\.$#',
'count' => 1,
'path' => __DIR__ . '/src/Html.php',
];
$ignoreErrors[] = [
// identifier: deadCode.unreachable
'message' => '#^Unreachable statement \\- code above always terminates\\.$#',
Expand Down
8 changes: 4 additions & 4 deletions src/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -3051,11 +3051,11 @@ public static function showDateTimeField($name, $options = [])

$date_format = Toolbox::getDateFormat('js') . " H:i:S";

$min_attr = !empty($p['min'])
? "minDate: '{$p['min']}',"
$min_attr = !empty($p['mindate'])
? "minDate: '{$p['mindate']}',"
: "";
$max_attr = !empty($p['max'])
? "maxDate: '{$p['max']}',"
$max_attr = !empty($p['maxdate'])
? "maxDate: '{$p['maxdate']}',"
: "";

$locale = Locale::parseLocale($_SESSION['glpilanguage']);
Expand Down

0 comments on commit ce4fb61

Please sign in to comment.