Some data is stored – or at least presented – in the 'YYYY-MM-DD
hh:mm:ss' format
within Rave. An example of this can be seen in the creation datetime and
modified datetime for the Categories section of the admin.

I propose that the API return the dates as an ISO 8601 string: '
YYYY-MM-DDTHH:mm:ssZ'. The benefits of this is that it's more easily parsed
by libraries like Angular (ng-date) and moment.js. And, of course, once one
of these libraries parses a date you have the full functionality of the
library available to you. ng-date is a great filter that lets us present
the datetimes in a more human-readable format, and moment.js is the de
facto solution to doing anything beyond the simplest operations with
datetimes.

Note that this suggestion (and every suggestion Carl and I propose) are
agnostic to how the data is stored in the database. That might not need to
change at all. All this is referring to is what the API returns.

For simplicity we're designing our mock API for the Angular branch around
the ISO 8601 format.

Reply via email to