Previous button behaving the same as Next button - View Bookings/Schedules
bravismore-mugadza opened this issue · comments
It seems to me that this bug is fixed in Git already but not released now.
For me this hot-fix worked:
--- ./lib/Common/Date.php.orig 2023-09-13 11:09:58.833684809 +0200
+++ ./lib/Common/Date.php 2023-09-13 11:25:09.534329873 +0200
@@ -439,6 +439,11 @@
return !$this->IsWeekday();
}
+ private function getOperator(int $number): string
+ {
+ return $number < 0 ? " -" : " +";
+ }
+
/**
* @param int $days
* @return Date
@@ -446,7 +451,7 @@
public function AddDays($days)
{
// can also use DateTime->modify()
- return new Date($this->Format(self::SHORT_FORMAT) . " +" . $days . " days", $this->timezone);
+ return new Date($this->Format(self::SHORT_FORMAT) . $this->getOperator($days) . abs($days) . " days", $this->timezone);
}
/**
Applied the hot fix and indeed it fixed the anomaly.