diff --git a/dist/js/datepicker.js b/dist/js/datepicker.js
index bfa7b35..b517efd 100644
--- a/dist/js/datepicker.js
+++ b/dist/js/datepicker.js
@@ -47,7 +47,7 @@ var Datepicker;
this.currentDate = this.opts.start;
this.currentView = this.opts.defaultView;
- this.selectedDate = '';
+ this.selectedDate = [];
this.views = {};
this.init()
@@ -110,7 +110,6 @@ var Datepicker;
this.date = new Date(d.year + 10, 0, 1);
break;
}
-
},
prev: function () {
@@ -409,11 +408,15 @@ Datepicker.Cell = function () {
},
_getDayHtml: function (date) {
- var _class = "datepicker--cell datepicker--cell-day";
+ var _class = "datepicker--cell datepicker--cell-day",
+ currentDate = new Date(),
+ d = Datepicker.getParsedDate(date);
- if (this.d.isWeekend(date.getDay())) _class += " -weekend-";
- if (date.getMonth() != this.d.currentDate.getMonth()) _class += " -another-month-";
- if (date.getDate() == new Date().getDate()) _class += ' -current-';
+ if (this.d.isWeekend(d.day)) _class += " -weekend-";
+ if (d.month != this.d.parsedDate.month) _class += " -another-month-";
+ if (d.date == currentDate.getDate() &&
+ d.month == currentDate.getMonth() &&
+ d.year == currentDate.getFullYear()) _class += ' -current-';
return '
' + date.getDate() + '
';
},
diff --git a/js/datepicker/body.js b/js/datepicker/body.js
index 90e934a..6ca3640 100644
--- a/js/datepicker/body.js
+++ b/js/datepicker/body.js
@@ -85,11 +85,15 @@
},
_getDayHtml: function (date) {
- var _class = "datepicker--cell datepicker--cell-day";
+ var _class = "datepicker--cell datepicker--cell-day",
+ currentDate = new Date(),
+ d = Datepicker.getParsedDate(date);
- if (this.d.isWeekend(date.getDay())) _class += " -weekend-";
- if (date.getMonth() != this.d.currentDate.getMonth()) _class += " -another-month-";
- if (date.getDate() == new Date().getDate()) _class += ' -current-';
+ if (this.d.isWeekend(d.day)) _class += " -weekend-";
+ if (d.month != this.d.parsedDate.month) _class += " -another-month-";
+ if (d.date == currentDate.getDate() &&
+ d.month == currentDate.getMonth() &&
+ d.year == currentDate.getFullYear()) _class += ' -current-';
return '' + date.getDate() + '
';
},
diff --git a/js/datepicker/datepicker.js b/js/datepicker/datepicker.js
index d22795a..b57aa8d 100644
--- a/js/datepicker/datepicker.js
+++ b/js/datepicker/datepicker.js
@@ -47,7 +47,7 @@ var Datepicker;
this.currentDate = this.opts.start;
this.currentView = this.opts.defaultView;
- this.selectedDate = '';
+ this.selectedDate = [];
this.views = {};
this.init()
@@ -110,7 +110,6 @@ var Datepicker;
this.date = new Date(d.year + 10, 0, 1);
break;
}
-
},
prev: function () {