Skip to content

Commit b7d6eb2

Browse files
committed
review suggestions
1 parent ef697e4 commit b7d6eb2

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,20 @@ If the points are in a Cartesian CRS, the function returns the Euclidean distanc
542542
|===
543543

544544

545+
[[temporal-format-functions]]
546+
=== Temporal format functions
547+
548+
[options="header", cols="2a,5a"]
549+
|===
550+
| Cypher feature
551+
| Description
552+
553+
| xref:functions/temporal/format.adoc[`format()`]
554+
| Returns the temporal value as an ISO-formatted `STRING` or as a `STRING` formatted by the provided pattern.
555+
556+
|===
557+
558+
545559
[[vector-functions]]
546560
=== Vector functions
547561

modules/ROOT/pages/functions/temporal/format.adoc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
== format()
99

1010
The `format()` function creates dynamically formatted string representations of temporal instance and duration types.
11-
The output format can be customized via the `pattern` parameter.
12-
The `pattern` parameter follows the link:https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/format/DateTimeFormatter.html[Java DateTimeFormatter].
13-
If no pattern is specified, the function returns an ISO-formatted string.
1411

1512
.Details
1613
|===
@@ -22,6 +19,16 @@ If no pattern is specified, the function returns an ISO-formatted string.
2219
| *Returns* 3+| `STRING`
2320
|===
2421

22+
.Considerations
23+
|===
24+
| The output format can be customized via the `pattern` parameter.
25+
| The `pattern` parameter follows the link:https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/format/DateTimeFormatter.html[Java DateTimeFormatter].
26+
| If no pattern is specified, the function returns an ISO-formatted string.
27+
| Most characters yield a different output when they are repeated.
28+
| Some characters cannot be applied to certain types, for instance, `u` cannot be used to construct a string for a `LOCAL TIME` because it represents a year which is not part of the temporal value.
29+
| Any character that is not reserved, other than `[`, `]`, `{`, `}`, `#`, and `'`, are output directly. To ensure future compatibility it is recommended to wrap all characters that you want to output directly with single quotes.
30+
|===
31+
2532
[[query-functions-temporal-format-instance-types]]
2633
== Instance types
2734

@@ -219,14 +226,6 @@ The three occurrences of `p` add one space character of padding to the two digit
219226
| `'` | single quote | literal |
220227
|===
221228

222-
.Considerations
223-
|===
224-
| Most characters yield a different output when they are repeated.
225-
| Some characters cannot be applied to certain types, for instance, `u` cannot be used to construct a string for a `LOCAL TIME` because it represents a year which is not part of the temporal value.
226-
| For details, refer to the documentation of the link:https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/format/DateTimeFormatter.html[Java DateTimeFormatter].
227-
| Any character that is not reserved, other than `[`, `]`, `{`, `}`, `#`, and `'`, are output directly. To ensure future compatibility it is recommended to wrap all characters that you want to output directly with single quotes.
228-
|===
229-
230229

231230
[[query-functions-temporal-format-duration-types]]
232231
== Duration types
@@ -288,27 +287,28 @@ RETURN format(d, "w 'weeks' d 'days'") AS withWeeks, format(d, "d 'days'") AS wi
288287
289288
======
290289

291-
.Duration formatting with hours converted to minutes
290+
.Duration formatting, hours converted to minutes
292291
======
293292
294293
.Query
295294
[source, cypher, indent=0]
296295
----
297296
WITH duration({days: 4, hours: 5, minutes: 6, seconds: 7}) AS d
298-
RETURN format(d, "m 'minutes' s 'seconds'") AS withMinutes, format(d, "s 'seconds'") AS withoutMinutes
297+
RETURN format(d, "h 'hours' m 'minutes'") AS withHours, format(d, "m 'minutes'") AS withoutHours
299298
----
300299
301300
.Result
302301
[role="queryresult",options="header,footer",cols="2*<m"]
303302
|===
304303
305-
| withMinutes | withoutMinutes
306-
| "306 minutes 7 seconds" | "18367 seconds"
304+
| withHours | withoutHours
305+
| "5 hours 6 minutes" | "306 minutes"
307306
2+d|Rows: 1
308307
309308
|===
310309
311-
Note how the days cannot be converted to hours and do not affect the query result.
310+
Note how the four days cannot be converted to hours or minutes and do not affect the query result.
311+
Days are in a different component group than hours and minutes, see xref:#duration-character-table[].
312312
313313
======
314314

0 commit comments

Comments
 (0)