# Time Zone Planner

Find a meeting time across time zones. Turn the meeting round a 24-hour dial where each ring is someone's day.

Install with

```bash
npx shadcn@latest add https://kokonutui.com/r/timezone-planner.json
```

### motion

| Time | To               | Clock      | Status  |
|------|------------------|------------|----------|
| 0012345678900123456789:0012345678900123456789 | 0012345678900123456789:0012345678900123456789 | Paris   | 16:00–17:00 Working |
| 0012345678900123456789:0012345678900123456789 | 0012345678900123456789:0012345678900123456789 | New York|-6h  | 10:00–11:00 Working  |
| 0012345678900123456789:0012345678900123456789 | 0012345678900123456789:0012345678900123456789 | San Francisco|-9h | 07:00–08:00 Early  |
| 0012345678900123456789:0012345678900123456789 | 0012345678900123456789:0012345678900123456789 | Bengaluru|+4h30| 20:30–21:30 Late   |
| 0012345678900123456789:0012345678900123456789 | 0012345678900123456789:0012345678900123456789 | Tokyo   |+8h  | Mon 00:00–01:00 Asleep|

## Installation

Time Zone Planner is a free, open-source React component in the Kokonut UI [Inputs collection](/content/docs/inputs/index.html). Add it with the shadcn CLI:

```bash
npx shadcn@latest add @kokonutui/timezone-planner
```

Or add it by hand: install its packages, then copy the source into `components/kokonutui/timezone-planner.tsx`.

```bash
npm install motion
```

## Usage

```javascript
import TimezonePlanner from "@/components/kokonutui/timezone-planner";

export default function Example() {
  return <TimezonePlanner />;
}
```

## Props

### `people`
- `PlannerPerson[]` Default `built-in`
  The first person is "you": the dial runs on their clock.

### `date`
- `Date`
  The day to plan. Defaults to today.

### `defaultStart`
- `number` Default `16 * 60`
  Start of the meeting in minutes after midnight, on the first person's clock.

### `defaultDuration`
- `number` Default `60`
  Length of the meeting in minutes.

### `onChange`
- `(slot: PlannerSlot) => void`
  Called when the slot settles: after a drag, a key press or Best time.

### `className`
- `string`
  Extra classes for the root element.

### PlannerPerson
| Field       | Type     | Description                                 |
|-------------|----------|---------------------------------------------|
| `id`       | required | `string`                                   |
| `name`     | required | `string`                                   |
| `city`     | required | `string`                                   |
| `timeZone` | required | `string` IANA zone, such as "America/New_York" |
| `workStart`| optional | `number` Start of their working day, in local hours.|
| `workEnd`  | optional | `number` End of their working day, in local hours. |

### PlannerSlot
| Field      | Type     | Description                                                       |
|------------|----------|-------------------------------------------------------------------|
| `start`    | required | `Date`                                                            |
| `end`      | required | `Date`                                                            |
| `available`| required | `string[]` Ids of the people for whom the whole slot is in working hours.|

## Dependencies

| Needs                           | Version      | Comes from                  |
|--------------------------------|--------------|------------------------------|
| `motion`                       | `^12.23.25` | npm, installed by the CLI    |
| `cn` from `lib/utils.ts`      |              | shadcn init                  |
| React                          | `19`        | Your app                     |
| Tailwind CSS                   | `4`         | Your app                     |

No provider, font or global CSS to set up: the file works as soon as it lands.
