silverstripe / cwp

Common Web Platform (CWP) features module. We strongly recommend using it for all new CWP projects. Future features will be delivered here.
https://www.cwp.govt.nz
BSD 3-Clause "New" or "Revised" License
10 stars 26 forks source link

Event filter date formats don't match examples in labels without a datepicker #190

Open robbieaverill opened 5 years ago

robbieaverill commented 5 years ago

CWP 2.3.x-dev

In a browser without HTML5 date field support (e.g. Safari) if you enter the dates in events or news CWP pages using the format in the field labels and search, it comes back as a different format to that suggested:

image

You don't notice this with a date picker field because it presents it as a browser rendered UI control instead.

brynwhyman commented 5 years ago

Taking the NZ govt style guide as a reference (it doesn't explicitly call this out) we should look at changing the expect format in the backend and field label to be dd mm yyyy, not yyyy mm dd as part of this too.

Reference: https://www.govt.nz/about/about-this-website/style-and-design/the-govt-nz-style-guide/#numbers-dates-and-times

Edit: This would also align with what the date picker that browsers like Chrome and Firefox provide:

image

sachajudd commented 5 years ago

@robbieaverill was this fixed in https://github.com/silverstripe/cwp/pull/59?

robbieaverill commented 5 years ago

@sachajudd - #59 changed the format of the labels to match the example input format when you're using a browser that supports date picker fields.

This issue still remains in that if your browser doesn't support native HTML5 datepickers, the field label example is still not the same as the input field. The label would say (example 12/05/1995) but the field's format would be 1995-05-12.

My suggestion would be to drop the example from the label entirely.