Comments (6)
Thanks @michelengelen !
Just wanted to add that that if you have a string date stored in your database, then I would avoid converting it to a Date
object then to a dayjs
object, passing the string directly to dayjs
is probably safer.
from mui-x.
@imparvez I think that @flaviendelangle suggested avoiding the extra headache of re-creating date objects of different types if there is no need for that.
Consider just passing a string of the date to the dayjs.utc
function in turn avoiding the intermediate Date
object usage.
- dayjs.utc(new Date(Date.UTC(2022,3,17)));
+ dayjs.utc('2022-04-17');
from mui-x.
The implementation is correct. I did adjust your example a bit by using the new Date(Date.UTC())
construct. Check it here.
I do know that there are some problems with using dayjs
with timezones, especially when a timezone with a 00:00/00:00 offset is used.
Is there anythig else I can help you with?
from mui-x.
Thank you @michelengelen for your help. I think this helps me a lot. And also thank you for the heads-up about dayjs
from mui-x.
Great that I could help you. I'll close this issue now.
Feel free to reopen if you have questions regarding this. Thanks! 🙇🏼
from mui-x.
@flaviendelangle but I think when working with UTC time standard, v6 date picker doesn't behave what it should be and for that reason @michelengelen has suggested to use new Date(Date.UTC())
. Correct me if I'm wrong? Thanks
from mui-x.
Related Issues (20)
- [pickers] onAccept fired even when date is invalid, without information about error HOT 2
- [data grid] Different edit behaviour with/without controlled rowModesModel HOT 3
- [question] Is there a way to access the GridValidRowModel from the GridColDef 'type' parameter? HOT 1
- [data grid] Can't delete multiple cells with cellSelection HOT 2
- [data grid] Can paste cell content into non-editable cells HOT 4
- [AdapterDateFns] Error installation latest version of date-fs package HOT 2
- [test] closed Issue workflow HOT 1
- [data grid] Is there a way to use the onClick function of GridToolbarColumnsButton on other component? HOT 6
- [data grid] Skip tab focus on custom cell HOT 10
- [data grid] Quick filter for child table (Master Detail) from parent table HOT 1
- [data grid] Is it possible to expand detail panel on row click or on any other columns HOT 4
- [data grid] onColumnWidthChange called before autosize affects column width HOT 1
- [data grid] row virtualization memory leak HOT 1
- [data grid] Filter Panel Customization HOT 1
- [data grid] How to move checked row from one grid to another grid in MUI Datagrid premium? HOT 5
- [question] DataGrid row virtualization issue, rows not appearing on scroll HOT 5
- [data grid] Uploading files to mui x datagrid making it understand that cell is updated after file upload HOT 4
- [data grid] Hide column icon-separator for column resizable='false' HOT 2
- [pickers] Console error about non-boolean attribute 'focused' when using `DatePicker` / `DateTimePicker` for custom columns in `DataGrid` HOT 4
- [charts] series prop information is missing in PieChart API page HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mui-x.