Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
745 views
in Technique[技术] by (71.8m points)

javascript - How to set timezone in material-ui/DatePicker

I have an application built with Reactjs(front-end) and MeteroJS(back-end), I am using material-ui as UI design library. Recently we have implemented a globalization functionality in app, While developing global clock functionalities We have faced an issue with material-ui/DatePicker. In a search form I tried to create a date picker with user-specified timezone using material-ui/DatePicker and moment-timezone packages, and I passed the input date like this:

new Date(moment.tz("userTimeZone").endOf('day'))

But the datepicker is automatically converting the date to system local time + specified timezone time. How can I set specified timezone time in my DatePicker?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...