Skip to content

Commit 8d97a9c

Browse files
committed
v4.7.0
Added ability to set customButtons as function
1 parent e63be96 commit 8d97a9c

File tree

11 files changed

+214
-192
lines changed

11 files changed

+214
-192
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# EventCalendar changelog
22

3+
## 4.7.0
4+
October 10, 2025
5+
* Added ability to set `customButtons` as function ([499](https://github.com/vkurko/calendar/issues/499))
6+
37
## 4.6.0
48
September 4, 2025
59
* Added `eventOrder` option ([549](https://github.com/vkurko/calendar/issues/549))

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ See [demo](https://vkurko.github.io/calendar/) and [changelog](CHANGELOG.md).
44

55
Full-sized drag & drop JavaScript event calendar with resource & timeline views:
66

7-
* Lightweight (33kb [br](https://en.wikipedia.org/wiki/Brotli) compressed)
7+
* Lightweight (37kb [br](https://en.wikipedia.org/wiki/Brotli) compressed)
88
* 100% human-coded
99
* Zero-dependency (standalone bundle)
1010
* Used on over 70,000 websites with [Bookly](https://wordpress.org/plugins/bookly-responsive-appointment-booking-tool/)
@@ -244,8 +244,8 @@ This bundle contains a version of the calendar that includes all plugins and is
244244

245245
The first step is to include the following lines of code in the `<head>` section of your page:
246246
```html
247-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.6.0/dist/event-calendar.min.css">
248-
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.6.0/dist/event-calendar.min.js"></script>
247+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.7.0/dist/event-calendar.min.css">
248+
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.7.0/dist/event-calendar.min.js"></script>
249249
```
250250

251251
<details>
@@ -370,7 +370,7 @@ function (text) {
370370
</table>
371371

372372
### customButtons
373-
- Type `object`
373+
- Type `object` or `function`
374374
- Default `{}`
375375

376376
Defines custom buttons that can be used in the [headerToolbar](#headertoolbar).
@@ -430,6 +430,23 @@ If `true`, the button will appear pressed/active
430430
</tr>
431431
</table>
432432

433+
This option can also be set as a callback function that receives default custom button object and should return a new one:
434+
435+
```js
436+
function (customButtons) {
437+
// return new custom buttons object
438+
}
439+
```
440+
<table>
441+
<tr>
442+
<td>
443+
444+
`customButtons`
445+
</td>
446+
<td>An object with default custom buttons</td>
447+
</tr>
448+
</table>
449+
433450
### date
434451
- Type `Date` or `string`
435452
- Default `new Date()`

docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<link rel="manifest" href="site.webmanifest">
1313
<link rel="stylesheet" href="global.css?20231021">
1414

15-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.6.0/dist/event-calendar.min.css">
16-
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.6.0/dist/event-calendar.min.js"></script>
15+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.7.0/dist/event-calendar.min.css">
16+
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@4.7.0/dist/event-calendar.min.js"></script>
1717

1818
<style>
1919
.ec-timeline .ec-time, .ec-timeline .ec-line {

0 commit comments

Comments
 (0)