|
@@ -495,7 +495,7 @@ discard block |
|
|
block discarded – undo |
|
495
|
495
|
} |
|
496
|
496
|
|
|
497
|
497
|
// Deal with the end date unless it ends just before midnight at which point we don't need to go further |
|
498
|
|
- if ($this->end_date->format('H:i') == '23:59' ) { |
|
|
498
|
+ if ($this->end_date->format('H:i') == '23:59') { |
|
499
|
499
|
$itemized[AbstractEvent::BAT_HOUR][$ey][$em]['d' . $ed] = array(); |
|
500
|
500
|
$itemized[AbstractEvent::BAT_MINUTE][$ey][$em]['d' . $ed] = array(); |
|
501
|
501
|
} else { |
|
@@ -522,14 +522,14 @@ discard block |
|
|
block discarded – undo |
|
522
|
522
|
|
|
523
|
523
|
$counter = (int)$period_start->format('i'); |
|
524
|
524
|
$start_minute = $counter; |
|
525
|
|
- foreach($period as $minute) { |
|
|
525
|
+ foreach ($period as $minute) { |
|
526
|
526
|
// Doing minutes so set the values in the minute array |
|
527
|
|
- $itemized[AbstractEvent::BAT_MINUTE][$minute->format('Y')][$minute->format('n')]['d'. $minute->format('j')]['h'. $minute->format('G')]['m' .$minute->format('i')] = $this->getValue(); |
|
|
527
|
+ $itemized[AbstractEvent::BAT_MINUTE][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')]['m' . $minute->format('i')] = $this->getValue(); |
|
528
|
528
|
// Let the hours know that it cannot determine availability |
|
529
|
|
- $itemized[AbstractEvent::BAT_HOUR][$minute->format('Y')][$minute->format('n')]['d'. $minute->format('j')]['h'. $minute->format('G')] = -1; |
|
|
529
|
+ $itemized[AbstractEvent::BAT_HOUR][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')] = -1; |
|
530
|
530
|
$counter++; |
|
531
|
531
|
|
|
532
|
|
- if ($counter == 60 && $start_minute!==0) { |
|
|
532
|
+ if ($counter == 60 && $start_minute !== 0) { |
|
533
|
533
|
// Not a real hour - leave as is and move on |
|
534
|
534
|
$counter = 0; |
|
535
|
535
|
$start_minute = 0; |
|
@@ -538,7 +538,7 @@ discard block |
|
|
block discarded – undo |
|
538
|
538
|
// Did a real whole hour so initialize the hour |
|
539
|
539
|
$itemized[AbstractEvent::BAT_HOUR][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')] = $this->getValue(); |
|
540
|
540
|
// We have a whole hour so get rid of the minute info |
|
541
|
|
- unset($itemized[AbstractEvent::BAT_MINUTE][$minute->format('Y')][$minute->format('n')]['d'. $minute->format('j')]['h'. $minute->format('G')]); |
|
|
541
|
+ unset($itemized[AbstractEvent::BAT_MINUTE][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')]); |
|
542
|
542
|
$counter = 0; |
|
543
|
543
|
$start_minute = 0; |
|
544
|
544
|
} |
|
@@ -560,7 +560,7 @@ discard block |
|
|
block discarded – undo |
|
560
|
560
|
// Set the end date to the last day of the month so that we are sure to get that last month |
|
561
|
561
|
$adjusted_end_day = new \DateTime($this->end_date->format('Y-n-t')); |
|
562
|
562
|
|
|
563
|
|
- $daterange = new \DatePeriod($this->start_date, $interval ,$adjusted_end_day); |
|
|
563
|
+ $daterange = new \DatePeriod($this->start_date, $interval, $adjusted_end_day); |
|
564
|
564
|
|
|
565
|
565
|
$itemized = array(); |
|
566
|
566
|
|
|
@@ -569,10 +569,10 @@ discard block |
|
|
block discarded – undo |
|
569
|
569
|
$start = TRUE; |
|
570
|
570
|
|
|
571
|
571
|
// Cycle through each month |
|
572
|
|
- foreach($daterange as $date) { |
|
|
572
|
+ foreach ($daterange as $date) { |
|
573
|
573
|
|
|
574
|
574
|
// Check if we have |
|
575
|
|
- if (($date->format('Y-n') != $old_month) || ($start)) { |
|
|
575
|
+ if (($date->format('Y-n') != $old_month) || ($start)) { |
|
576
|
576
|
|
|
577
|
577
|
$year = $date->format("Y"); |
|
578
|
578
|
$dayinterval = new \DateInterval('P1D'); |