Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example for material-ui datepickers / timepickers

using date-fns-tz

How to use

this is based on create-react-app-with-typescript (https://github.com/mui/material-ui):

Install it and run:

npm install
npm start

or:

Edit on CodeSandbox

The idea behind the example

In most cases you will be fine with saving utc times and displaying local times.

but in some circumstances (like a physical shop opening time) you want to show the time in a specific tz, no matter where the browser is.

this example is how i managed to put that specific tz in a mui time picker.

feedback and suggestions welcome.

About

example of editing a date using material ui datepicker or timepicker in a different-timezone (using react hook forms, date-fns)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages