-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
d8b9a36
to
dd5518f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for this @jonathaningram! just some small comments.
static_src/util/format_date.js
Outdated
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to remove valid comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can revert. One of the reason these kinds of comments are not great is that they become outdated unless updated when the function is updated. When I went to update the comment I realised I was describing what the ~4 line function was doing, so it seemed redundant, so I removed it.
static_src/util/format_date.js
Outdated
*/ | ||
export default function formatDateTime(dateString, timezone = 'Etc/UTC') { | ||
const d = moment(dateString); | ||
const formatDateTime = (str, timezone = 'Etc/UTC') => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
str
-> dateString
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I named it str
because technically the caller can pass any string that is not a date, e.g. formatDateTime('random non date string')
and str
encapsulates that an arbitrary string was passed. Per https://golang.org/src/time/format.go?s=23626:23672#L762
I can change it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that. I can see the case for leaving it as str. Ignore this and just bring back the comment
@jcscottiii OK, reinstated the comment. Ready for review again! |
Pulls out the non-US dates change from #1256