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

Commit 1776b08

Browse files
committed
fix number #257 , show calendar with respect of date format, thanks to @petr-vysotskiy
1 parent d02e171 commit 1776b08

5 files changed

+11
-9
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularjs-datepicker",
3-
"version": "2.1.17",
3+
"version": "2.1.18",
44
"description": "A datepicker directive for angularjs.",
55
"authors": [
66
"Filippo Oretti <filippo.oretti@gmail.com",

dist/angular-datepicker.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@
158158
//, dateMaxLimit
159159
, dateDisabledDates = $scope.$eval($scope.dateDisabledDates)
160160
, date = new Date()
161-
, dateString
162161
, isMouseOn = false
163162
, isMouseOnInput = false
164163
, preventMobile = typeof attr.datepickerMobile !== 'undefined' && attr.datepickerMobile !== 'false'
@@ -405,8 +404,11 @@
405404
if (theCalendar.classList) {
406405

407406
theCalendar.classList.add('_720kb-datepicker-open');
408-
dateString = angular.element(angular.element(theCalendar).parent()[0].querySelector('input')).val().replace(/\//g, '-');
409-
date = new Date(dateString);
407+
if (dateFormat) {
408+
date = localDateTimestamp(thisInput[0].value.toString(), dateFormat);
409+
} else {
410+
date = new Date(thisInput[0].value.toString());
411+
}
410412
$scope.selectedMonth = Number($filter('date')(date, 'MM'));
411413
$scope.selectedDay = Number($filter('date')(date, 'dd'));
412414
$scope.selectedYear = Number($filter('date')(date, 'yyyy'));

dist/angular-datepicker.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-datepicker.sourcemap.map

+1-1
Large diffs are not rendered by default.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularjs-datepicker",
3-
"version": "2.1.17",
3+
"version": "2.1.18",
44
"description": "A datepicker directive for angularjs.",
55
"homepage": "http://720kb.github.io/angular-datepicker",
66
"keywords": [

0 commit comments

Comments
 (0)