PluginProbe
ShiftController Employee Shift Scheduling / 4.9.24
ShiftController Employee Shift Scheduling v4.9.24
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
← All changes | hc3/time.php +9 -20 trunk4.9.24 View file →
@@ -44,9 +44,9 @@
44 44 protected $_weekdays = array();
45 45
46 46 var $timezone = '';
47 47
48 - function __construct( ?HC3_Settings $settings = NULL )
48 + function __construct( HC3_Settings $settings = NULL )
49 49 {
50 50 parent::__construct();
51 51
52 52 $localiseThis = array('__Jan__', '__Feb__', '__Mar__', '__Apr__', '__May__', '__Jun__', '__Jul__', '__Aug__', '__Sep__', '__Oct__', '__Nov__', '__Dec__');
@@ -67,11 +67,8 @@
67 67
68 68 $tz = '';
69 69
70 70 $tz = $settings->get('datetime_timezone');
71 - if( ! $tz ){
72 - $tz = '';
73 - }
74 71 $tz = trim( $tz );
75 72
76 73 if( ! strlen($tz) ){
77 74 $tz = $this->getDefaultTimezone();
@@ -101,9 +98,8 @@
101 98 // $this->setTimezone( $tz );
102 99 // }
103 100 }
104 101
105 -#[\ReturnTypeWillChange]
106 102 public function setTimezone( $tz )
107 103 {
108 104 if( is_array($tz) )
109 105 $tz = $tz[0];
@@ -214,12 +210,8 @@
214 210 $this->setDateDb( $date );
215 211
216 212 $hours = substr($datetime, 8, 2);
217 213 $minutes = substr($datetime, 10, 2);
218 -
219 - $hours = (int) $hours;
220 - $minutes = (int) $minutes;
221 -
222 214 $this->setTime( $hours, $minutes, 0 );
223 215
224 216 return $this;
225 217 }
@@ -292,20 +284,17 @@
292 284 }
293 285
294 286 public function getTimeInDay()
295 287 {
296 - $dateTimeDb = $this->formatDateTimeDb();
297 - // 202404042030
288 + $timestamp = $this->getTimestamp();
298 289
299 - $hourString = substr( $dateTimeDb, 8, 2 );
300 - $minuteString = substr( $dateTimeDb, 10, 2 );
290 + $this->setStartDay();
291 + $timestamp2 = $this->getTimestamp();
301 292
302 - $h = (int) $hourString;
303 - $m = (int) $minuteString;
293 + $return = $timestamp - $timestamp2;
304 294
305 - $ret = 60 * 60 * $h + 60 * $m;
306 -
307 - return $ret;
295 + $this->setTimestamp( $timestamp );
296 + return $return;
308 297 }
309 298
310 299 public function getWeekStartsOn()
311 300 {
@@ -577,9 +566,9 @@
577 566
578 567 return $return;
579 568 }
580 569
581 - public function getMonthMatrix( $skipWeekdays = array(), $daysPerWeek = 7 )
570 + public function getMonthMatrix( $skipWeekdays = array() )
582 571 {
583 572 $overlap = TRUE; // if to show dates of prev/next month
584 573 $overlap = FALSE; // if to show dates of prev/next month
585 574
@@ -617,9 +606,9 @@
617 606 $this->setDateDb( $rexDate );
618 607 while( $rexDate <= $endDate ){
619 608 $week = array();
620 609 $weekSet = FALSE;
621 - for( $weekDay = 0; $weekDay < $daysPerWeek; $weekDay++ ){
610 + for( $weekDay = 0; $weekDay <= 6; $weekDay++ ){
622 611 $thisWeekday = $this->getWeekday();
623 612 $setDate = $rexDate;
624 613
625 614 if( ! $overlap ){