Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/angular-material-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ angular.module("materialCalendar").directive("calendarMd", ["$compile", "$parse"
}
};

var transformDateToCompare = function (date) {
return date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear();
};

return {
restrict: "E",
scope: {
Expand Down Expand Up @@ -291,11 +295,12 @@ angular.module("materialCalendar").directive("calendarMd", ["$compile", "$parse"
(cb || angular.noop)(data);
};

//If haven't sent date with 00:00:00 (h/m/s). Here can adjust it
var dateFind = function (arr, date) {
var index = -1;
angular.forEach(arr, function (d, k) {
if (index < 0) {
if (angular.equals(date, d)) {
if (transformDateToCompare(date) == transformDateToCompare(d)) {
index = k;
}
}
Expand Down