New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref(ts): Refactor DateTime component #14235
Conversation
@@ -5,7 +5,16 @@ import _ from 'lodash'; | |||
|
|||
import ConfigStore from 'app/stores/configStore'; | |||
|
|||
class DateTime extends React.Component { | |||
type Props = { | |||
date: any; |
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.
Even though the propTypes is any, we should be a bit more specific on the type. It looks like it can be either: 1) string, 2) number (e.g. unix timestamp), or 3) Date object
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.
Let's use moment.MomentInput
. I suspect the coercedDate line might be unnecessary and can be deleted as moment can handle string and unix time as input.
eaa3e2c
to
af31c2d
Compare
@@ -8,15 +8,15 @@ type Options = { | |||
type Device = { | |||
Type: string; | |||
Generation: string; | |||
ANumber: string[]; |
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.
Are these changes supposed to be in this PR?
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.
yeah I just thought I'd add them in here instead of doin a separate pr - can always pull them out if thats better
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.
Looks like a totally separate change right?
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.
It's not related to the component in this PR and is not covered by the description, pulling it out separately is better
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.
cool - pulled it out and put it in #14267
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!
af31c2d
to
c6b9dfe
Compare
No description provided.