Skip to content

Commit

Permalink
fix: a bunch of copy-paste mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
RiedleroD committed Sep 30, 2024
1 parent 41b7230 commit e8ac93f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
6 changes: 3 additions & 3 deletions lbplanner/classes/model/reservation.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class reservation {
/**
* @var ?DateTimeImmutable $datetime the date this reservation ends at, with time filled in
*/
private ?DateTimeImmutable $datetime;
private ?DateTimeImmutable $datetime_end;

/**
* Constructs a reservation
Expand Down Expand Up @@ -124,7 +124,7 @@ public function prepare_for_db(): object {
public function get_datetime(): DateTimeImmutable {
if (is_null($this->datetime)) {
$slot = $this->get_slot();
$this->datetime = slot_helper::amend_date_with_unit_time($this->date, $slot->startunit);
$this->datetime = slot_helper::amend_date_with_unit_time($slot->startunit, $this->date);
}

return $this->datetime;
Expand All @@ -138,7 +138,7 @@ public function get_datetime(): DateTimeImmutable {
public function get_datetime_end(): DateTimeImmutable {
if (is_null($this->datetime)) {
$slot = $this->get_slot();
$this->datetime_end = slot_helper::amend_date_with_unit_time($this->date, $slot->startunit + $slot->duration)
$this->datetime_end = slot_helper::amend_date_with_unit_time($slot->startunit + $slot->duration, $this->date);
}

return $this->datetime_end;
Expand Down
5 changes: 2 additions & 3 deletions lbplanner/services/slots/book_reservation.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
use local_lbplanner\model\reservation;

/**
* Returns all slots the user can theoretically reserve.
* This does not include times the user has already reserved a slot for.
* Books a reservation for the user
*
* @package local_lbplanner
* @subpackage services_plan
* @subpackage services_slots
* @copyright 2024 necodeIT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion lbplanner/services/slots/get_my_slots.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* This does not include times the user has already reserved a slot for.
*
* @package local_lbplanner
* @subpackage services_plan
* @subpackage services_slots
* @copyright 2024 necodeIT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion lbplanner/services/slots/get_student_slots.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* This does not include times the user has already reserved a slot for.
*
* @package local_lbplanner
* @subpackage services_plan
* @subpackage services_slots
* @copyright 2024 necodeIT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion lbplanner/services/slots/get_supervisor_slots.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* Returns all slots a supervisor can see.
*
* @package local_lbplanner
* @subpackage services_plan
* @subpackage services_slots
* @copyright 2024 necodeIT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand Down
6 changes: 2 additions & 4 deletions lbplanner/services/slots/unbook_reservation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@

use local_lbplanner\helpers\slot_helper;
use local_lbplanner\helpers\notifications_helper;
use local_lbplanner\model\reservation;
use local_lbplanner\enums\NOTIF_TRIGGER;

/**
* Returns all slots the user can theoretically reserve.
* This does not include times the user has already reserved a slot for.
* Unbooks reservation
*
* @package local_lbplanner
* @subpackage services_plan
* @subpackage services_slots
* @copyright 2024 necodeIT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand Down

0 comments on commit e8ac93f

Please sign in to comment.