Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date alias fields don't have same return type as plain fields #22804

Open
hanneskuettner opened this issue Jun 20, 2024 · 0 comments
Open

Date alias fields don't have same return type as plain fields #22804

hanneskuettner opened this issue Jun 20, 2024 · 0 comments

Comments

@hanneskuettner
Copy link
Member

hanneskuettner commented Jun 20, 2024

Describe the Bug

When requesting a date field once normally and once through an alias their return types differ. It seems that alias fields do not receive the same post processing that unaliased date fields receive.

To Reproduce

Especially obvious on SQLite, but also present in other vendors.

  • Create a collection with a date_created datetime field
  • Request GET /items/<collection>?fields=date,date_created&alias[date]=date_created

Response (in SQLite)

{
  "data": [
    {
      "date": 1718628004468,
      "date_create": "2024-06-17T14:40:04"
    }
  ]
}

Directus Version

v10.12.0

Hosting Strategy

Self-Hosted (Docker Image)

Database

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant