Open mcMickJuice opened 6 years ago
We are moving away from using moment as much as we can because of performance reasons. I would be in favor of unix timestamps.
Just curious, what kind of performance issues did you face? What actions or situations did moment perform poorly?
Hi, We're using date-fns that uses the standard Date object. Maybe that is a way.
I like the approach that this library takes:
/* eslint-disable */
import MuiPickersUtilsProvider from 'material-ui-pickers/utils/MuiPickersUtilsProvider';
// pick a time library utils to inject into the app
import MomentUtils from 'material-ui-pickers/utils/moment-utils';
import DateFnsUtils from 'material-ui-pickers/utils/date-fns-utils';
import LuxonUtils from 'material-ui-pickers/utils/luxon-utils';
function App() {
return (
<MuiPickersUtilsProvider utils={DateFnsUtils}>
<Root />
</MuiPickersUtilsProvider>
);
}
render(<App />, document.querySelector('#app'));
The library would expose some standard providers (like the ones in material-ui-pickers). Users could also inject their own, would just need to define the interface.
Thanks for creating an issue! Please fill out the sections below so that we can accommodate your request:
What kind of issue are you experiencing?
This library accepts a moment object, Date or unix timestamp in some cases...but not other cases. Moreover, throughout the app, the code expects dates to be a Moment object...sometimes. I'd like to standardize datetime and require that the values all be unix timestamps.
Pros:
Cons: