Skip to content

Commit bc11f87

Browse files
committed
docs: render simple noonSafe example
1 parent 2f0c580 commit bc11f87

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from "react";
2+
3+
import { DayPicker } from "react-day-picker";
4+
5+
export function TimeZoneNoonSafeSimple() {
6+
const timeZone = "Asia/Dubai";
7+
8+
return (
9+
<DayPicker
10+
timeZone={timeZone}
11+
weekStartsOn={1}
12+
noonSafe
13+
fixedWeeks
14+
showOutsideDays
15+
/>
16+
);
17+
}

examples/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export * from "./TestCase2864";
102102
export * from "./Testcase1567";
103103
export * from "./TimeZone";
104104
export * from "./TimeZoneNoonSafe";
105+
export * from "./TimeZoneNoonSafeSimple";
105106
export * from "./timezone/TestCase2833";
106107
export * from "./Utc";
107108
export * from "./WeekIso";

website/docs/localization/setting-time-zone.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ By default, DayPicker uses the browser’s local time zone. You can override thi
99

1010
The time zone can be specified as either an [IANA time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) identifier or a UTC offset.
1111

12-
| Prop Name | Type | Description |
13-
| ----------- | --------- | --------------------------------------------------------------------------- |
14-
| `timeZone` | `string` | The IANA time zone to use when rendering the calendar. |
15-
| `noonSafe` | `boolean` | Keep calendar math at noon in the time zone to avoid historical drift. |
16-
17-
> `noonSafe` is experimental as of v9.13.0 and may change in future releases.
12+
| Prop Name | Type | Description |
13+
| ---------- | --------- | ------------------------------------------------------------------------------------ |
14+
| `timeZone` | `string` | The IANA time zone to use when rendering the calendar. |
15+
| `noonSafe` | `boolean` | Experimental. Keep calendar math at noon in the time zone to avoid historical drift. |
1816

1917
```tsx
2018
<DayPicker timeZone="UTC" /> // Coordinated Universal Time
@@ -74,5 +72,5 @@ This override is optional and only needed when you render months that include
7472
offsets with seconds and want to avoid duplicate or missing days in the grid.
7573

7674
<BrowserWindow bodyStyle={{ justifyContent: "start" }}>
77-
<Examples.TimeZoneNoonSafe />
75+
<Examples.TimeZoneNoonSafeSimple />
7876
</BrowserWindow>

0 commit comments

Comments
 (0)