File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ import YearItemNumber from "../../examples/ts/yearItemNumber?raw";
109109import WeekPicker from "../../examples/ts/weekPicker?raw" ;
110110import ExcludeWeeks from "../../examples/ts/excludeWeeks?raw" ;
111111import ExternalForm from "../../examples/ts/externalForm?raw" ;
112+ import Timezone from "../../examples/ts/timezone?raw" ;
112113
113114export const EXAMPLE_CONFIG : IExampleConfig [ ] = [
114115 {
@@ -564,4 +565,10 @@ export const EXAMPLE_CONFIG: IExampleConfig[] = [
564565 title : "External Form" ,
565566 component : ExternalForm ,
566567 } ,
568+ {
569+ title : "Timezone" ,
570+ description :
571+ "Display and handle dates in a specific timezone using the timeZone prop. Requires date-fns-tz as a peer dependency." ,
572+ component : Timezone ,
573+ } ,
567574] ;
Original file line number Diff line number Diff line change 1+ const Timezone = ( ) => {
2+ const [ selectedDate , setSelectedDate ] = useState < Date | null > ( new Date ( ) ) ;
3+
4+ return (
5+ < DatePicker
6+ selected = { selectedDate }
7+ onChange = { setSelectedDate }
8+ showTimeSelect
9+ timeFormat = "HH:mm"
10+ timeIntervals = { 15 }
11+ dateFormat = "MMMM d, yyyy h:mm aa (zzz)"
12+ timeZone = "America/New_York"
13+ />
14+ ) ;
15+ } ;
16+
17+ render ( Timezone ) ;
You can’t perform that action at this time.
0 commit comments