2768 fix date format archived accounts page#2911
Conversation
|
@entrotech Note for review: I used the formatDate util function to format the date, however it doesn't convert the date to the user's local time zone Example: In util.js, there is also a formatDatetime function which will convert the time zone, but it will also display the hours/minutes |
There was a problem hiding this comment.
Thanks for catching the problem with missing Time Zone conversions for formatDate. As you pointed out, the formatDate function need to do a time zone conversion. In addition, these functions were confusing to use because the formatDate function only worked property when you gave it a JavaScript date, and the formatDatetime function only worked when you gave an ISO formatted date string. We kind of need to use both date representation in the app in different places - ISO strings are ok for display, sorting and comparison, but there are places where we actually need to do arithmetic with Javascript dates. So I modified the utility functions to handle both representations, and added comments to explicitly explain the acceptable input formats, and added the commit to your PR.
Good work!
There was a problem hiding this comment.
Great, thank you for the review!
entrotech
left a comment
There was a problem hiding this comment.
Good work. I reviewed the formatDate and formatDatetime functions and modified them to make sure both do a time zone conversion to Pacific Time and can work with javascript dates or ISO date strings as inputs.
What changes did you make?
Why did you make the changes (we will use this info to test)?
Issue-Specific User Account
If you registered a new, temporary TDM User Account for this issue, indicate the
username (i.e., email address) for the account.
Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)
Visuals before changes are applied
Visuals after changes are applied