Skip to content

SDK doesn't have time functions (fe year()) in TS definitions #25950

@rijkvanzanten

Description

@rijkvanzanten

Describe the Bug

When trying to use a time function in a field name in the SDK filters, TypeScript will throw errors that the field doesn't exist

To Reproduce

For example:

readItems("my-collection", {
  filter: {
    "year(some_date)": {
      _eq: "2024",
    },
  },
});

causes a TS warning:

Object literal may only specify known properties, and ‘‘year(some_date)’’ does not exist in type ‘QueryFilter<DirectusSchema, DirectusProject>’.

Directus Version

v11.12.0

Hosting Strategy

Self-Hosted (Docker Image)

Database

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions