Skip to content

Most dates are mangled in the UI #4927

@mathemancer

Description

@mathemancer

Description

Dates which are:

  • old enough to have a '0' in the thousands place of the year,
  • old enough to be marked BC, or
  • far enough into the future to have more than 4 digits in the year

are all mangled by the UI.

This comprises the vast majority of dates which are possible to store in PostgreSQL, many of which are pretty reasonable to see in real-world data.

The problem also affects Date/Time types.

Expected behavior

The UI should render these correctly, or at least throw an error.

To Reproduce

Use the table creation flow, copy-and-paste data, and paste the following:

the_date
2001-12-31
0200-12-31
0001-12-31
20010-12-31
2001-12-31 BC

Note that the preview shows the wrong things, but the response from the API is correct:

Image

The issue persists in the table page:

Image

The behavior also affects individual record pages, as well as editing operations.

Additional context

Our date input and display seem to be optimized for very current dates to the exclusion of other considerations. This is a problem for, e.g., a museum storing information about artifacts or art from the middle ages, much less BC. A lower priority would be correctly handling dates so far in the future that they need more than 4 digits in the year, but it still seems like we should at least throw an error in that case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: requirementsThe problem is clear and worth solving, but we're not yet sure of the best solutiontype: bugwork: frontendRelated to frontend code in the mathesar_ui directory

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions