RaythaHQ / raytha

Raytha is a powerful CMS with an easy-to-use interface and fast performance. It offers custom content types, a template engine, and various access controls. It supports multiple storage providers and an automatically generated REST API. Upgrade your development workflow with Raytha.
MIT License
155 stars 30 forks source link

`date field` should store the date in a standardized format #216

Open apexdodge opened 6 days ago

apexdodge commented 6 days ago

Our date field for the content item stores the date in the format selected in the admin settings.

This is normally fine, but I realize there is an edge case: What happens if the admins change their mind after populating the website with content, and now want the date format to be different. So they go into admin settings and change the date format. This will result in some date fields being stored as the old option so this causes a problem.

Solution:

We should store all date field as yyyy-MM-dd and perform all calculations as such in queries, but we convert to the desired format in admin settings in-memory.

This would require a database migration script, so we'll save this for a 1.x release.