Skip to content

Datetime fields should validate and alert on invalid input #1138

Open
@Toutouwai

Description

@Toutouwai

Short description of the issue

A datetime field accepts any input but cannot actually save it, and replaces invalid values with the Unix epoch. The problem is that there is no feedback to the user that the data they have entered is invalid.

It's not totally unreasonable for a user to believe that a field that is asking for a date might accept input like "2015", or "August", or "every Tuesday", etc. And they might select "Save + Exit" so the low chance that they detect the incorrect date after Save is reduced to no chance at all.

Best outcome would be if the inputfield validated the input with JS on blur, to alert the user as soon as possible. Failing that the field should show an error on save and the value should be cleared. Storing "1 January 1970" is definitely not what the user expects if they mistakenly enter an invalid date.

Setup/Environment

  • ProcessWire version: 3.0.153

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions