Skip to content
Permalink
Browse files

wrap caption month and year in their own divs

  • Loading branch information...
Corey Holland
Corey Holland committed Oct 24, 2015
1 parent f17ab6b commit d973408bcc6c472cfd86c143c254764f5fe5f533
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/main.js
@@ -118,7 +118,9 @@ var Kalendae = function (targetElement, options) {
util.make('a', {'class':classes.previousMonth}, $title); //previous button
util.make('a', {'class':classes.nextYear}, $title); //next button
util.make('a', {'class':classes.nextMonth}, $title); //next button
$caption = util.make('span', {'class':classes.caption}, $title); //title caption
$caption = util.make('div', {'class':classes.caption}, $title); //title caption
util.make('div', {'class':classes.captionMonth}, $caption); //month text
util.make('div', {'class':classes.captionYear}, $caption); //year text

//column headers
$header = util.make('div', {'class':classes.header}, $cal);
@@ -251,7 +253,8 @@ Kalendae.prototype = {
subscribe :null, /* object containing events to subscribe to */

columnHeaderFormat :'dd', /* number of characters to show in the column headers */
titleFormat :'MMMM, YYYY', /* format mask for month titles. See momentjs.com for rules */
titleMonthFormat :'MMMM', /* format mask for month titles. */
titleYearFormat :'YYYY', /* format mask for year titles. */
dayNumberFormat :'D', /* format mask for individual days */
dayAttributeFormat :'YYYY-MM-DD', /* format mask for the data-date attribute set on every span */
parseSplitDelimiter : /,\s*|\s+-\s+/, /* regex to use for splitting multiple dates from a passed string */
@@ -273,6 +276,8 @@ Kalendae.prototype = {
previousYear :'k-btn-previous-year',
nextYear :'k-btn-next-year',
caption :'k-caption',
captionMonth :'k-caption-month',
captionYear :'k-caption-year',
header :'k-header',
days :'k-days',
week :'k-week',
@@ -493,7 +498,8 @@ Kalendae.prototype = {
//if the first day of the month is less than our week start, back up a week

cal = this.calendars[i];
cal.caption.innerHTML = month.format(this.settings.titleFormat);
cal.caption.querySelector('.k-caption-month').innerHTML = month.format(this.settings.titleMonthFormat);
cal.caption.querySelector('.k-caption-year').innerHTML = month.format(this.settings.titleYearFormat);
j = 0;
w = 0;
do {

0 comments on commit d973408

Please sign in to comment.
You can’t perform that action at this time.