-
Notifications
You must be signed in to change notification settings - Fork 20
Convert dates to standard ISO 8601 date/time string #254
Comments
What about using https://www.npmjs.com/package/dateformat ? |
@bcipolli it's not that we can't do it on the front-end. Angular already has built in filters that allow us to change how the date looks, but it only accepts ISO 8601, because this is the most standardized. We could use the native JavaScript date object, but that's not always consistent, (depending on the browser). I could also strip out the slashes, format the date with Angular and then put the slashes back in, but that just adds to the amount of code that will need to be applied to every single date that we display on a page, unnecessarily, which affects load time, user experience, etc... Also, I've noticed that the format for dates that are being returned in the API, varies. For example, the date for Basically, this isn't super urgent, but it'd be nice to standardize on this in general. If the data coming back from Netfile is in multiple formats, we may want to bring this to their attention. If it isn't, and we're formatting the dates with slashes (aka locale), we shouldn't. Date and time can get confusing, and if locale format is used, it can sometimes result in what (in our case) could be perceived as multiple instances in time, for the same moment in time (you can read more about it here) |
Gotcha, sounds good 👍. Definitely the dates should be standardized when they are stored, and output in a standardized format :) |
👍 |
is it possible to convert dates to this format for the front-end to consume? Otherwise we'll have to do a whole bunch of string manipulations for every date. Just to format the strings as a date. So that we can do something else with them afterwards...
The text was updated successfully, but these errors were encountered: