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

Commit

Permalink
fix number #257 , show calendar with respect of date format, thanks to
Browse files Browse the repository at this point in the history
  • Loading branch information
45kb committed May 5, 2017
1 parent d02e171 commit 1776b08
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angularjs-datepicker",
"version": "2.1.17",
"version": "2.1.18",
"description": "A datepicker directive for angularjs.",
"authors": [
"Filippo Oretti <filippo.oretti@gmail.com",
Expand Down
8 changes: 5 additions & 3 deletions dist/angular-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
//, dateMaxLimit
, dateDisabledDates = $scope.$eval($scope.dateDisabledDates)
, date = new Date()
, dateString
, isMouseOn = false
, isMouseOnInput = false
, preventMobile = typeof attr.datepickerMobile !== 'undefined' && attr.datepickerMobile !== 'false'
Expand Down Expand Up @@ -405,8 +404,11 @@
if (theCalendar.classList) {

theCalendar.classList.add('_720kb-datepicker-open');
dateString = angular.element(angular.element(theCalendar).parent()[0].querySelector('input')).val().replace(/\//g, '-');
date = new Date(dateString);
if (dateFormat) {
date = localDateTimestamp(thisInput[0].value.toString(), dateFormat);
} else {
date = new Date(thisInput[0].value.toString());
}
$scope.selectedMonth = Number($filter('date')(date, 'MM'));
$scope.selectedDay = Number($filter('date')(date, 'dd'));
$scope.selectedYear = Number($filter('date')(date, 'yyyy'));
Expand Down
6 changes: 3 additions & 3 deletions dist/angular-datepicker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/angular-datepicker.sourcemap.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angularjs-datepicker",
"version": "2.1.17",
"version": "2.1.18",
"description": "A datepicker directive for angularjs.",
"homepage": "http://720kb.github.io/angular-datepicker",
"keywords": [
Expand Down

0 comments on commit 1776b08

Please sign in to comment.