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

Fix and Update #330

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Angular datepicker is an angularjs directive that generates a datepicker calenda

The Angularjs Datepicker is developed by [720kb](http://720kb.net).

## Update 2018/12/11
Removed all javascript: void to support Angular 1.7 and above.
Added functionality to auto change month when next or previous month's date is clicked.

## Requirements

AngularJS v1.3+
Expand Down
18 changes: 9 additions & 9 deletions dist/angular-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@
return [
'<div class="_720kb-datepicker-calendar-header">',
'<div class="_720kb-datepicker-calendar-header-left">',
'<a class="_720kb-datepicker-calendar-month-button" href="javascript:void(0)" ng-class="{\'_720kb-datepicker-item-hidden\': !willPrevMonthBeSelectable()}" ng-click="prevMonth()" title="{{ buttonPrevTitle }}">',
'<a class="_720kb-datepicker-calendar-month-button" href="" ng-class="{\'_720kb-datepicker-item-hidden\': !willPrevMonthBeSelectable()}" ng-click="prevMonth()" title="{{ buttonPrevTitle }}">',
prevButton,
'</a>',
'</div>',
'<div class="_720kb-datepicker-calendar-header-middle _720kb-datepicker-calendar-month">',
'{{month}}&nbsp;',
'<a href="javascript:void(0)" ng-click="paginateYears(year); showYearsPagination = !showYearsPagination;">',
'<a href="" ng-click="paginateYears(year); showYearsPagination = !showYearsPagination;">',
'<span>',
'{{year}}',
'<i ng-class="{\'_720kb-datepicker-calendar-header-closed-pagination\': !showYearsPagination, \'_720kb-datepicker-calendar-header-opened-pagination\': showYearsPagination}"></i>',
'</span>',
'</a>',
'</div>',
'<div class="_720kb-datepicker-calendar-header-right">',
'<a class="_720kb-datepicker-calendar-month-button" ng-class="{\'_720kb-datepicker-item-hidden\': !willNextMonthBeSelectable()}" href="javascript:void(0)" ng-click="nextMonth()" title="{{ buttonNextTitle }}">',
'<a class="_720kb-datepicker-calendar-month-button" ng-class="{\'_720kb-datepicker-item-hidden\': !willNextMonthBeSelectable()}" href="" ng-click="nextMonth()" title="{{ buttonNextTitle }}">',
nextButton,
'</a>',
'</div>',
Expand All @@ -78,15 +78,15 @@
return [
'<div class="_720kb-datepicker-calendar-header" ng-show="showYearsPagination">',
'<div class="_720kb-datepicker-calendar-years-pagination">',
'<a ng-class="{\'_720kb-datepicker-active\': y === year, \'_720kb-datepicker-disabled\': !isSelectableMaxYear(y) || !isSelectableMinYear(y)}" href="javascript:void(0)" ng-click="setNewYear(y)" ng-repeat="y in paginationYears track by $index">',
'<a ng-class="{\'_720kb-datepicker-active\': y === year, \'_720kb-datepicker-disabled\': !isSelectableMaxYear(y) || !isSelectableMinYear(y)}" href="" ng-click="setNewYear(y)" ng-repeat="y in paginationYears track by $index">',
'{{y}}',
'</a>',
'</div>',
'<div class="_720kb-datepicker-calendar-years-pagination-pages">',
'<a href="javascript:void(0)" ng-click="paginateYears(paginationYears[0])" ng-class="{\'_720kb-datepicker-item-hidden\': paginationYearsPrevDisabled}">',
'<a href="" ng-click="paginateYears(paginationYears[0])" ng-class="{\'_720kb-datepicker-item-hidden\': paginationYearsPrevDisabled}">',
prevButton,
'</a>',
'<a href="javascript:void(0)" ng-click="paginateYears(paginationYears[paginationYears.length -1 ])" ng-class="{\'_720kb-datepicker-item-hidden\': paginationYearsNextDisabled}">',
'<a href="" ng-click="paginateYears(paginationYears[paginationYears.length -1 ])" ng-class="{\'_720kb-datepicker-item-hidden\': paginationYearsNextDisabled}">',
nextButton,
'</a>',
'</div>',
Expand All @@ -107,13 +107,13 @@

return [
'<div class="_720kb-datepicker-calendar-body">',
'<a href="javascript:void(0)" ng-repeat="px in prevMonthDays" class="_720kb-datepicker-calendar-day _720kb-datepicker-disabled">',
'<a href="" ng-repeat="px in prevMonthDays" class="_720kb-datepicker-calendar-day _720kb-datepicker-disabled" ng-click="prevMonth()">',
'{{px}}',
'</a>',
'<a href="javascript:void(0)" ng-repeat="item in days" ng-click="setDatepickerDay(item)" ng-class="{\'_720kb-datepicker-active\': selectedDay === item && selectedMonth === monthNumber && selectedYear === year, \'_720kb-datepicker-disabled\': !isSelectableMinDate(year + \'/\' + monthNumber + \'/\' + item ) || !isSelectableMaxDate(year + \'/\' + monthNumber + \'/\' + item) || !isSelectableDate(monthNumber, year, item) || !isSelectableDay(monthNumber, year, item),\'_720kb-datepicker-today\': item === today.getDate() && monthNumber === (today.getMonth() + 1) && year === today.getFullYear() && !selectedDay}" class="_720kb-datepicker-calendar-day">',
'<a href="" ng-repeat="item in days" ng-click="setDatepickerDay(item)" ng-class="{\'_720kb-datepicker-active\': selectedDay === item && selectedMonth === monthNumber && selectedYear === year, \'_720kb-datepicker-disabled\': !isSelectableMinDate(year + \'/\' + monthNumber + \'/\' + item ) || !isSelectableMaxDate(year + \'/\' + monthNumber + \'/\' + item) || !isSelectableDate(monthNumber, year, item) || !isSelectableDay(monthNumber, year, item),\'_720kb-datepicker-today\': item === today.getDate() && monthNumber === (today.getMonth() + 1) && year === today.getFullYear() && !selectedDay}" class="_720kb-datepicker-calendar-day">',
'{{item}}',
'</a>',
'<a href="javascript:void(0)" ng-repeat="nx in nextMonthDays" class="_720kb-datepicker-calendar-day _720kb-datepicker-disabled">',
'<a href="" ng-repeat="nx in nextMonthDays" class="_720kb-datepicker-calendar-day _720kb-datepicker-disabled" ng-click="nextMonth()">',
'{{nx}}',
'</a>',
'</div>'
Expand Down
Loading