mdehoog / Semantic-UI-Calendar

Calendar module for Semantic UI
MIT License
805 stars 126 forks source link

Add cell formatter #57

Closed bennothommo closed 7 years ago

bennothommo commented 7 years ago

Add a "cell" formatter callback to allow for direct manipulation of each individual cell in a calendar or time picker.

The cell argument is the cell element, the date argument is the Date Object representing that cell and the cellOptions argument is an object containing the cell types being displayed, and whether the cell is adjacent, disabled or active.

JSBin example here: http://jsbin.com/hafenikefi/edit?html,css,js,output

In the example above, I use the cell formatter to highlight the public holidays in Australia.

mdehoog commented 7 years ago

Good idea, thanks for the PR!

I made a minor change (renamed type to mode), see aeeb821654c4e494bfdbc1ce4bee88b328bc950e.

bennothommo commented 7 years ago

Not a problem. Thanks for the merge!