evoluteur / evolutility-ui-react

Framework for building CRUD UIs for Hasura GraphQL with models rather than code.
https://evoluteur.github.io/evodemo/
GNU Affero General Public License v3.0
113 stars 30 forks source link

Date format is US only #7

Closed david-pfx closed 5 years ago

david-pfx commented 5 years ago

All dates displayed by Evolutility seem to be in US format (mm/dd/yyyy). The culprit code appears to be this line in format.js:64.

return dateParts[1]+'/'+dateParts[2]+'/'+dateParts[0];

It really does need to format dates according to national preferences (mine are European dd/mm/yyyy).

david-pfx commented 5 years ago

This check-in on the naxl-ui fork uses moment to format dates and times:

https://github.com/david-pfx/naxl-ui/commit/f07151535f6399be1b376a41b3dfc4da1cfbd8bd

evoluteur commented 5 years ago

Excellent. Please submit a pull request for me to merge it. Thanks.

david-pfx commented 5 years ago

Sure thing, but unfortunately your latest check-in introduces a merge conflict (on field type literals). I need to resolve that first.

david-pfx commented 5 years ago

Having some problems with moment and webpack. It seems that the only locales that survive into the bundle are those explicitly listed. I'm inclined to suggest luxon instead. Any objections?

evoluteur commented 5 years ago

I'd rather not add new dependencies.

david-pfx commented 5 years ago

I agree, but I don't think you can handle dates without a dependency on something. There is currently no dependency on moment, as all the mentions are commented out, so the field is open.

evoluteur commented 5 years ago

OK for luxon then.

david-pfx commented 5 years ago

I'm on it.

evoluteur commented 5 years ago

Your pull request is in. Thanks again. It is working. I can close this issue.

david-pfx commented 5 years ago

Please do. Happy to be able to help.

I think it needs something in the readme, mentioning the issue of locales and browser settings and ensuring any needed locales have been included in the build. I'll leave that to you.