-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[pickers] Add support for UTC on moment adapter #8031
Conversation
@@ -90,4 +94,12 @@ export class AdapterMoment | |||
public getWeekNumber = (date: defaultMoment.Moment) => { | |||
return date.week(); | |||
}; | |||
|
|||
public getWeekdays = () => { |
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 think I'll write an RFC in the coming weeks, proposing to finally migrate all the adapters to our repository.
We are duplicating more and more logic...
These are the results for the performance tests:
|
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.
If we reimplement more function, we will also have to test them
value={moment.utc()} | ||
minDate={moment.utc().startOf('month')} | ||
// ❌ Invalid props | ||
value={moment()} | ||
minDate={moment().startOf('month')} |
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.
Adding an empty line could simplify the understanding at first look (without having to stop to think about it)
value={moment.utc()} | |
minDate={moment.utc().startOf('month')} | |
// ❌ Invalid props | |
value={moment()} | |
minDate={moment().startOf('month')} | |
value={moment.utc()} | |
minDate={moment.utc().startOf('month')} | |
// ❌ Invalid props | |
value={moment()} | |
minDate={moment().startOf('month')} |
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.
Prettier automatically removes it, I agree that it would be nice otherwise
Doc preview
moment.utc
does not have the static properties (same issue we had fordayjs
).I think we could update the JSDoc of
dateLibInstance
to say that it's the instance we use to parse dates, not the instance we use for the rest.