Fix date types/arrays (phan notices)

This commit is contained in:
MDW 2025-01-05 16:18:22 +01:00
parent 694342484d
commit 3fb717bb68
No known key found for this signature in database

View File

@ -3,7 +3,7 @@
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This file is a modified version of datepicker.php from phpBSM to fix some
@ -233,7 +233,8 @@ function displayBox($selectedDate, $month, $year)
//print "x ".$thedate." y"; // $thedate = first day of month
$firstdate = dol_getdate($thedate);
//var_dump($firstdateofweek);
$mydate = dol_get_first_day_week(1, $month, $year, true); // mydate = cursor date
$mydate_tmp = dol_get_first_day_week(1, $month, $year, true); // mydate = cursor date
$mydate = dol_getdate(dol_mktime(12, 0, 0, $mydate_tmp['first_month'], $mydate_tmp['first_day'], $mydate_tmp['first_year']));
// Loop on each day of month
$stoploop = 0;
@ -241,7 +242,7 @@ function displayBox($selectedDate, $month, $year)
$cols = 0;
while (!$stoploop) {
//print_r($mydate);
if ($mydate < $firstdate) { // At first run
if ($mydate[0] < $firstdate[0]) { // At first run
echo "<tr class=\"dpWeek\">";
//echo $conf->global->MAIN_START_WEEK.' '.$firstdate["wday"].' '.$startday;
$cols = 0;
@ -291,7 +292,7 @@ function displayBox($selectedDate, $month, $year)
$stoploop = 1;
} else {
$mydate = dol_getdate($thedate);
if ($firstdate["month"] != $mydate["month"]) {
if ($firstdate["mon"] != $mydate["mon"]) {
$stoploop = 1;
}
}