diff --git a/content/_partials/query-functions.md b/content/_partials/query-functions.md index 7ec38a64..351d3a2a 100644 --- a/content/_partials/query-functions.md +++ b/content/_partials/query-functions.md @@ -9,8 +9,8 @@ The syntax for using a function is `function(field)`. | `week` | Extract the week from a datetime/date/timestamp field | | `day` | Extract the day from a datetime/date/timestamp field | | `weekday` | Extract the weekday from a datetime/date/timestamp field | -| `hour` | Extract the hour from a datetime/date/timestamp field | -| `minute` | Extract the minute from a datetime/date/timestamp field | -| `second` | Extract the second from a datetime/date/timestamp field | +| `hour` | Extract the hour from a datetime/time/timestamp field | +| `minute` | Extract the minute from a datetime/time/timestamp field | +| `second` | Extract the second from a datetime/time/timestamp field | | `count` | Extract the number of items from a JSON array or relational field | | `json` | Extract a specific value from a JSON field using path notation | diff --git a/content/tutorials/3.tips-and-tricks/advanced-types-with-the-directus-sdk.md b/content/tutorials/3.tips-and-tricks/advanced-types-with-the-directus-sdk.md index 6ffde866..c5c43570 100644 --- a/content/tutorials/3.tips-and-tricks/advanced-types-with-the-directus-sdk.md +++ b/content/tutorials/3.tips-and-tricks/advanced-types-with-the-directus-sdk.md @@ -82,10 +82,9 @@ interface CollectionA { } ``` -There are currently 3 literal types that can be applied. The first 2 are both used to apply the `count(field)` +There are currently 5 literal types that can be applied. The first 2 are both used to apply the `count(field)` array function in the `filter`/`field` auto-complete suggestions, these are the -`'json'` and `'csv'` string literal types. The `'datetime'` string literal type which is used to apply all -datetime functions in the `filter`/`field` auto-complete suggestions. +`'json'` and `'csv'` string literal types. The `'datetime'`, `'date'`, and `'time'` string literal types which are used to apply related functions in the `filter`/`field` auto-complete suggestions. ```ts interface CollectionA { @@ -96,13 +95,15 @@ interface CollectionA { tags: 'csv'; // [!code ++] json_field: 'json'; // [!code ++] date_created: 'datetime'; // [!code ++] + start_time: 'time'; // [!code ++] + event_date: 'date'; // [!code ++] } ``` In the output types these string literals will get resolved to their appropriate types: - `'csv'` resolves to `string[]` -- `'datetime'` resolves to `string` +- `'datetime'`, `'date'`, and `'time'` resolve to `string` - `'json'` resolves to [`JsonValue`](https://github.com/directus/directus/blob/main/sdk/src/types/output.ts#L105) ::callout{icon="material-symbols:warning-rounded" color="warning"}