Skip to content

Change dates format #89

Description

@kuvakina

We have a problem with changing dates format from mm/dd/yyyy to dd/mm/yyyy (For NES and OneLondon)

  • 1) on SPV , in issues:
    vvv1.png

  • 2) on MPV, DOB

  • 2.1:
    vvv2.png

  • 2.2:
    vvv3.png

From @BogdanScherban :
Hi, Francois!

DateInput and DateField components have default date format: "MM/DD/YYYY".

I tried to set format "DD-MM-YYYY" for DateField by setting locales and options according to https://marmelab.com/react-admin/Fields.html#datefield

<DateField locales="en-GB" options={{ year: "numeric", month: "numeric", day: "numeric" }} />

Unfortunately, in this case format is the same. But what means "If Intl is not available, it ignores the locales and options props."? How can we enable using of it?

For DateInput I tried to use extra plugin https://github.com/vascofg/react-admin-date-inputs (according to RA-manual):

  1. install this plugin by:
    npm install react-admin-date-inputs --save

  2. Add required attributes to DateInput
    <DateInput source="birthDate" label="Born" options={{ format: 'DD-MM-YYYY' }} fullWidth />

  3. Try to create build. When I doing this, I have an error:
    68747470733a2f2f696d616765732e7a656e68756275736572636f6e74656e742e636f6d2f3563643932633633396336326561316361363662323461322f30656336646136632d663461362d343966632d623534352d613564326334303462376561.png

If we try to install this module, following error occurs:
68747470733a2f2f696d616765732e7a656e68756275736572636f6e74656e742e636f6d2f3563643932633633396336326561316361363662323461322f32393734613931342d306236652d343935392d623635662d633732323539636635623561.png

For this reason I can't use vascofg/react-admin-date-inputs.

Besides this, I tried to solve the issue by a lot of variants which are presented at stackoverflow (and other similar sources), but all of them don't work...

@fzaninotto

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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