Skip to content

Commit

Permalink
chore: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jpvmrcd committed Nov 1, 2023
1 parent 040f807 commit 6bc2e70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ Generates a calendar based on year and month arguments. If no arguments are pass
| dayNames | `string[7]` | Sets the days of the week. Should start from Sunday. |
| startDay | `string` | Sets the start day of the week. The value for `startDay` should match one of the values defined in `dayNames`. Defaults to `Sun`. |
| onCellAdded | (args: [onCellAddedArgs](#onCellAddedArgs)) => void | Event triggered on every calendar cell added to the calendar. |
| onDateClicked | (args: [onDateClicked](#onDateClicked)) => void | Event triggered on every calendar date cell click. |
| onDateClicked | (args: [onDateClickedArgs](#onDateClickedArgs)) => void | Event triggered on every calendar date cell click. |

### `onCellAddedArgs`
| Name | Type | Description |
|-|-|-|
| td | `HTMLTableCellElement` | Current `td` being rendered. |
| dateISOString | `string` | ISO formatted date of the cell being rendered. |

### `onDateClicked`
### `onDateClickedArgs`
| Name | Type | Description |
|-|-|-|
| event | `Event` | The `Event` triggered. |
Expand Down Expand Up @@ -211,7 +211,7 @@ cal.render();
### Render calendar with `options.OnDateClicked`
```typescript
const cal = new Calendar(document.getElementById('calendar'));
cal.options.onDateClicked = (args: OnCellAddedArgs) => {
cal.options.onDateClicked = (args: OnDateClickedArgs) => {
console.log(args);
// > {event: MouseEvent, dateISOString: "YYYY-MM-DD"}
};
Expand Down

0 comments on commit 6bc2e70

Please sign in to comment.