dbushell/Pikaday — pull request #178 by Zykino (2014-08-15 15:19:26+00:00)
Title: Add 'events' option, to differentiate regular days from "reserved" ones with differents type of events

I needed the feature implemented by #152 but with possibility to use my own set of colors so I did that.
Here is my code when I use it :

this.Picker = this.$('#outageDates').pikaday({
events: [{ date: new Date('Sun Aug 10 2014'), backgroundColor: '#0099FF', color: '#000000' }] // or 'Sun Aug 10 2014' form
}).data('pikaday');

this.Picker.addEvents({ date: new Date('Fri Aug 01 2014'), backgroundColor: '#000000', color: '#FFFFFF' });
this.Picker.addEvents({ backgroundColor: '#0099FF', color: '#FFFFFF', date: new Date('Sat Aug 02 2014') });
this.Picker.addEvents({ backgroundColor: '#9966FF', color: '#FFFFFF', date: new Date('Sun Aug 03 2014') });
this.Picker.addEvents({ backgroundColor: '#FF0033', color: '#FFFFFF', date: new Date('Mon Aug 04 2014') });
this.Picker.addEvents({ backgroundColor: '#993300', color: '#FFFFFF', date: new Date('Tue Aug 05 2014') });

/* You can choose this way of declaring events too but you have to keep the same form all he time : object or Date string
this.Picker.addEvents('Fri Aug 01 2014');
this.Picker.addEvents('Sat Aug 02 2014');
this.Picker.addEvents('Sun Aug 03 2014');
this.Picker.addEvents('Mon Aug 04 2014');
this.Picker.addEvents('Tue Aug 05 2014');
*/
this.Picker.removeEvents(new Date('Sun Aug 03 2014'));

this.Picker.getEvents();