File size: 1,513 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Calendar Popover

This component shows a Popover with a calendar inside.

Beyond combining Popover and PostSchedule, this component connects with the state-tree, so in this way timezone data related to the site configuration is propagated automatically.

## Usage

```jsx
import { Button } from '@automattic/components';
import CalendarPopover from 'calypso/blocks/calendar-popover';

const toggle = () => this.setState( { show: ! this.state.show } );
const buttonRef = React.createRef();

function render() {
	return (
		<div>
			<Button ref={ buttonRef } onClick={ this.toggle }>
				Show Popover
			</Button>

			<CalendarPopover context={ buttonRef } isVisible={ this.state.show } />
		</div>
	);
}
```

## Props

The following props can be passed to the CalendarPopover component:

### `children`

<table>
	<tr><td>Type</td><td>Element</td></tr>
	<tr><td>Required</td><td>No</td></tr>
</table>

#### Connect Props

### `gmtOffset`

<table>
	<tr><td>Type</td><td>Number</td></tr>
</table>

The site's UTC offset.

### `timezoneValue`

<table>
	<tr><td>Type</td><td>String</td></tr>
</table>

The site's timezone value, in the format of 'America/Araguaina (see <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>).

#### Props propagated to the `<Popover />`

- `autoPosition`
- `closeOnEsc`
- `ignoreContext`
- `isVisible`
- `position`
- `showDelay`
- `onClose`
- `onShow`

#### Props propagated to the `<PostSchedule />`

- `events`
- `selectedDay`
- `siteId`
- `onDateChange`
- `onMonthChange`