Skip to content

Commit

Permalink
Preparing 0.6 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Twipped committed Feb 25, 2016
1 parent 767a1d5 commit cac78ba
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 29 deletions.
43 changes: 28 additions & 15 deletions build/kalendae.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
/********************************************************************
* Kalendae, a framework agnostic javascript date picker *
* Copyright(c) 2013 Jarvis Badgley (chipersoft@gmail.com) *
* Copyright(c) 2013-2016 Jarvis Badgley (chipersoft@gmail.com) *
* http://github.com/ChiperSoft/Kalendae *
* Version 0.5.5 *
* Version 0.6.0 *
********************************************************************/

(function (undefined) {

var today, moment;
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['moment'], factory);
} else if ( typeof exports === 'object' ) {
// Node/CommonJS
module.exports = factory(require('moment'));
} else {
// Browser globals
window.Kalendae = factory();
}
} (function (moment) {
var getTodayYearDate = function() {
return Kalendae.moment().startOf('day').yearDay();
};

var Kalendae = function (targetElement, options) {
if (typeof document.addEventListener !== 'function' && !util.isIE8()) return;
Expand Down Expand Up @@ -342,11 +354,11 @@ Kalendae.prototype = {
disableNextYear: false,

directions: {
'past' :function (date) {return moment(date).startOf('day').yearDay() >= today.yearDay();},
'today-past' :function (date) {return moment(date).startOf('day').yearDay() > today.yearDay();},
'past' :function (date) {return moment(date).startOf('day').yearDay() >= getTodayYearDate();},
'today-past' :function (date) {return moment(date).startOf('day').yearDay() > getTodayYearDate();},
'any' :function (date) {return false;},
'today-future' :function (date) {return moment(date).startOf('day').yearDay() < today.yearDay();},
'future' :function (date) {return moment(date).startOf('day').yearDay() <= today.yearDay();}
'today-future' :function (date) {return moment(date).startOf('day').yearDay() < getTodayYearDate();},
'future' :function (date) {return moment(date).startOf('day').yearDay() <= getTodayYearDate();}
},

getSelectedAsDates : function () {
Expand Down Expand Up @@ -599,7 +611,7 @@ Kalendae.prototype = {

if (!(this.blackout(day) || this.direction(day) || (day.month() != month.month() && opts.dayOutOfMonthClickable === false)) || s>0) klass.push(classes.dayActive);

if (day.clone().startOf('day').yearDay() === today.yearDay()) klass.push(classes.dayToday);
if (day.clone().startOf('day').yearDay() === getTodayYearDate()) klass.push(classes.dayToday);

dateString = day.format(this.settings.dayAttributeFormat);
if (opts.dateClassMap[dateString]) klass.push(opts.dateClassMap[dateString]);
Expand Down Expand Up @@ -1185,7 +1197,10 @@ var MinPubSub = function(d){
}
};

};
};if (typeof moment !== 'undefined') {
Kalendae.moment = moment;
}

if (!Kalendae.moment) {
if (window.moment) {
Kalendae.moment = window.moment;
Expand All @@ -1202,8 +1217,6 @@ moment.fn.yearDay = function (input) {
return (typeof input === 'undefined') ? yearday :
this.add({ d : input - yearday });
};

today = Kalendae.moment().startOf('day');
if (typeof jQuery !== 'undefined' && (typeof document.addEventListener === 'function' || util.isIE8())) {
jQuery.fn.kalendae = function (options) {
this.each(function (i, e) {
Expand All @@ -1219,5 +1232,5 @@ if (typeof jQuery !== 'undefined' && (typeof document.addEventListener === 'func
};
}


})();
return Kalendae;
}));
Loading

0 comments on commit cac78ba

Please sign in to comment.