Skip to content

Commit 487ebcf

Browse files
Fix the PHP compatibility error of the appointments index API endpoint (#1678)
1 parent 49f9f6e commit 487ebcf

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ developers to maintain and readjust their custom modifications on the main proje
99

1010
- Fix the GTag script URL html rendering (#1666)
1111
- Fix the "Load More" JS error in secretaries page (#1677)
12+
- Fix the PHP compatibility error of the appointments index API endpoint (#1678)
1213

1314

1415

application/controllers/api/v1/Appointments_api_v1.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,23 @@ public function index(): void
6565
$date = request('date');
6666

6767
if (!empty($date)) {
68-
$where['DATE(start_datetime)'] = new DateTime($date)->format('Y-m-d');
68+
$where['DATE(start_datetime)'] = (new DateTime($date))->format('Y-m-d');
6969
}
7070

7171
// From query param.
7272

7373
$from = request('from');
7474

7575
if (!empty($from)) {
76-
$where['DATE(start_datetime) >='] = new DateTime($from)->format('Y-m-d');
76+
$where['DATE(start_datetime) >='] = (new DateTime($from))->format('Y-m-d');
7777
}
7878

7979
// Till query param.
8080

8181
$till = request('till');
8282

8383
if (!empty($till)) {
84-
$where['DATE(end_datetime) <='] = new DateTime($till)->format('Y-m-d');
84+
$where['DATE(end_datetime) <='] = (new DateTime($till))->format('Y-m-d');
8585
}
8686

8787
// Service ID query param.
@@ -275,7 +275,8 @@ private function notify_and_sync_appointment(array $appointment, string $action
275275
'company_name' => setting('company_name'),
276276
'company_email' => setting('company_email'),
277277
'company_link' => setting('company_link'),
278-
'company_color' => !empty($company_color) && $company_color != DEFAULT_COMPANY_COLOR ? $company_color : null,
278+
'company_color' =>
279+
!empty($company_color) && $company_color != DEFAULT_COMPANY_COLOR ? $company_color : null,
279280
'date_format' => setting('date_format'),
280281
'time_format' => setting('time_format'),
281282
];
@@ -358,7 +359,8 @@ public function destroy(int $id): void
358359
'company_name' => setting('company_name'),
359360
'company_email' => setting('company_email'),
360361
'company_link' => setting('company_link'),
361-
'company_color' => !empty($company_color) && $company_color != DEFAULT_COMPANY_COLOR ? $company_color : null,
362+
'company_color' =>
363+
!empty($company_color) && $company_color != DEFAULT_COMPANY_COLOR ? $company_color : null,
362364
'date_format' => setting('date_format'),
363365
'time_format' => setting('time_format'),
364366
];

0 commit comments

Comments
 (0)