Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Active day indication when dateSetHidden is set #291

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
16 changes: 11 additions & 5 deletions src/js/angular-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
$scope.year = Number($scope.year) + 1;
}
, localDateTimestamp = function localDateTimestamp(rawDate, dateFormatDefinition) {

var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|MMMM|MMM|MM|M|dd?d?|yy?yy?y?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g
,formatDate,dateSplit, m, d, y, index, el, longName, shortName;

Expand All @@ -294,7 +294,7 @@
if (rawDate.indexOf(shortName) !== -1) {
rawDate = rawDate.replace(shortName, index + 1);
break;
}
}
}

dateSplit = rawDate
Expand Down Expand Up @@ -323,11 +323,11 @@
}
case el.indexOf('y') !== -1: {
y = dateSplit[index - (formatDate.length - dateSplit.length)];
break;
break;
}
default: {
break;
}
break;
}
}
}

Expand Down Expand Up @@ -411,6 +411,9 @@
} else {
date = new Date(thisInput[0].value.toString());
}
if(isNaN(Date.parse(date)) && $scope.dateSet) {
date = new Date($scope.dateSet)
}
$scope.selectedMonth = Number($filter('date')(date, 'MM'));
$scope.selectedDay = Number($filter('date')(date, 'dd'));
$scope.selectedYear = Number($filter('date')(date, 'yyyy'));
Expand Down Expand Up @@ -449,6 +452,9 @@
} else {
date = new Date(thisInput[0].value.toString());
}
if(isNaN(Date.parse(date)) && $scope.dateSet) {
date = new Date($scope.dateSet)
}
$scope.selectedMonth = Number($filter('date')(date, 'MM'));
$scope.selectedDay = Number($filter('date')(date, 'dd'));
$scope.selectedYear = Number($filter('date')(date, 'yyyy'));
Expand Down