Skip to content

Commit c5d49b7

Browse files
committed
Added dateformats support
1 parent 1735c22 commit c5d49b7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Supporting/FileMakerLayout.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ private function buildScriptParameters(array|null $param): array
168168
* If $script is array with two elements, these are handled as values of "script" and "layout.response."
169169
* If it's three elements, these are "script", "script.param" and "layout.response."
170170
* If it's four elements, these are "script.prerequest", "script.presort", "script" and "layout.response."
171+
* @param int|null $dateformats; Use this option to specify date formats for date, time, and timestamp fields. The relevant values are: 0 for US, 1 for file locale, or 2 for ISO8601
171172
* @return FileMakerRelation|null Query result.
172173
* @throws Exception In case of any error, an exception arises.
173174
*/
@@ -176,7 +177,8 @@ public function query(array|null $condition = null,
176177
int $offset = 0,
177178
int $range = 0,
178179
array|null $portal = null,
179-
array|null $script = null): FileMakerRelation|null
180+
array|null $script = null,
181+
int $dateformats = null): FileMakerRelation|null
180182
{
181183
if ($this->restAPI->login()) {
182184
$headers = ["Content-Type" => "application/json"];
@@ -203,6 +205,9 @@ public function query(array|null $condition = null,
203205
} else {
204206
$params = ["layouts" => $this->layout, "records" => null];
205207
}
208+
if (!is_null($dateformats)) {
209+
$request["dateformats"] = $dateformats;
210+
}
206211
$this->restAPI->callRestAPI($params, true, $method, $request, $headers); // Throw Exception
207212
$this->restAPI->storeToProperties();
208213
$result = $this->restAPI->responseBody;

0 commit comments

Comments
 (0)