Skip to content

datetime expects the date to be formatted in American format if using slashes (m/d/y) #61

@sean-dunwoody

Description

@sean-dunwoody

When using the datetime field type, if slashes are used in the datetime then PHP assumes this to be in American date format (m/d/y) - https://www.php.net/manual/en/datetime.formats.php

This could be confusing for anyone not from the United States, and there is no ability to change the format that the frontend uses for the datetime.

It's possible to fix this if you can change the format of the date that is sent to the frontend, so maybe this isn't a bug? But it would be nice to be able to modify the format that the frontend expects, maybe in the yaml file:

example_field_date:
  type: datetime
  format: 'd/m/y H:i:s'

This would give added flexibility and make it clear to the user what format they should send the date as. Infact, it might be best to make format a required config for type: datetime to avoid confusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions