summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBeiri22 <beier1@hs-mittweida.de>2023-08-30 12:28:53 +0200
committerGitHub <noreply@github.com>2023-08-30 12:28:53 +0200
commitf616302496c824dd6a9fb2721c7df0c57b09708d (patch)
treecc6f3fc95d876ea66eebdd6d99885b917e56c620 /docs
parent35c785ea118d13112c771e4c00e6f9a21dd6ba65 (diff)
Duration type, simple date-duration-calculations and comparisons (#1843)
Diffstat (limited to 'docs')
-rw-r--r--docs/reference/types.md65
1 files changed, 65 insertions, 0 deletions
diff --git a/docs/reference/types.md b/docs/reference/types.md
index 365593f3..09cc2909 100644
--- a/docs/reference/types.md
+++ b/docs/reference/types.md
@@ -431,6 +431,71 @@ Returns the second of the datetime, if it exists. Otherwise, it returns
- returns: integer or none
+### ordinal()
+Returns the ordinal (day of the year) of the datetime, if it exists.
+Otherwise, it returns `{none}`.
+
+- returns: integer or none
+
+# Duration
+Represents a span of time. Can be created by either specifying a custom
+duration using the [`duration`]($func/datetime) function or by subtracting two
+[datetimes]($type/datetime).
+
+## Example
+```example
+#let duration = duration(
+ days: 4,
+ hours: 2,
+ minutes: 10,
+)
+
+#duration.hours()
+```
+
+## Methods
+### seconds()
+Returns the duration in seconds as a floating-point value.
+
+This function returns the total duration represented in seconds as a
+floating-point number. It does not provide the second component of the duration,
+but rather gives the overall duration in terms of seconds.
+
+- returns: float
+
+### minutes()
+Returns the duration in minutes as a floating-point value.
+
+This function returns the total duration represented in minutes as a
+floating-point number. It does not provide the minute component of the duration,
+but rather gives the overall duration in terms of minutes.
+
+- returns: float
+
+### hours()
+Returns the duration in hours as a floating-point value.
+
+This function returns the total duration represented in hours as a
+floating-point number. It does not provide the hour component of the duration,
+but rather gives the overall duration in terms of hours.
+- returns: float
+
+### days()
+Returns the duration in days as a floating-point value.
+
+This function returns the total duration represented in days as a
+floating-point number. It does not provide the day component of the duration,
+but rather gives the overall duration in terms of days.
+- returns: float
+
+### weeks()
+Returns the duration in weeks as a floating-point value.
+
+This function returns the total duration represented in weeks as a
+floating-point number. It does not provide the week component of the duration,
+but rather gives the overall duration in terms of weeks.
+- returns: float
+
# Symbol
A Unicode symbol.