Skip to content
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
2 changes: 1 addition & 1 deletion dist/ionic-datepicker.bundle.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/ionic-datepicker-modal.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ion-modal-view class="ionic_datepicker_modal">
<ion-header-bar class="header">
<h1 class="title">{{mainObj.titleLabel || selctedDateEpoch | date : mainObj.dateFormat}}</h1>
<h1 class="title">{{mainObj.titleLabel || selectedDateEpoch | date : mainObj.dateFormat}}</h1>
</ion-header-bar>
<ion-content class="ionic_datepicker_modal_content">
<div class="">
Expand Down Expand Up @@ -46,7 +46,7 @@ <h1 class="title">{{mainObj.titleLabel || selctedDateEpoch | date : mainObj.date
<div>
<div class="row text-center padding_top_zero" ng-repeat="row in rows track by $index">
<div class="col padding_zero date_col" ng-repeat="col in cols track by $index"
ng-class="{'selected_date': (dayList[row + $index].epoch === selctedDateEpoch),
ng-class="{'selected_date': (dayList[row + $index].epoch === selectedDateEpoch),
'today' : (dayList[row + $index].epoch == today),
'pointer_events_none':((disabledDates.indexOf(dayList[row + $index].epoch) >= 0) || (dayList[row + $index].disabled))}"
ng-click="dateSelected(dayList[row + $index])">
Expand Down
4 changes: 2 additions & 2 deletions src/ionic-datepicker-popup.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="selected_date_full">{{mainObj.titleLabel || selctedDateEpoch | date : mainObj.dateFormat}}</div>
<div class="selected_date_full">{{mainObj.titleLabel || selectedDateEpoch | date : mainObj.dateFormat}}</div>
<div class="date_selection">
<div class="row show_nav">
<div class="col col-10 prev_btn_section col-center" ng-click="prevMonth()">
Expand Down Expand Up @@ -43,7 +43,7 @@
<div>
<div class="row text-center padding_zero" ng-repeat="row in rows track by $index">
<div class="col no_padding date_col" ng-repeat="col in cols track by $index"
ng-class="{'selected_date': (dayList[row + $index].epoch === selctedDateEpoch),
ng-class="{'selected_date': (dayList[row + $index].epoch === selectedDateEpoch),
'today' : (dayList[row + $index].epoch == today),
'pointer_events_none':((disabledDates.indexOf(dayList[row + $index].epoch) >= 0) || dayList[row + $index].disabled)}"
ng-click="dateSelected(dayList[row + $index])">
Expand Down
22 changes: 11 additions & 11 deletions src/ionic-datepicker.provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ angular.module('ionic-datepicker.provider', [])
};

var changeDaySelected = function() {
var newSelectedDate = new Date($scope.selctedDateEpoch);
var newSelectedDate = new Date($scope.selectedDateEpoch);
newSelectedDate.setMonth($scope.currentDate.getMonth());
newSelectedDate.setYear($scope.currentDate.getFullYear());
$scope.selctedDateEpoch = newSelectedDate.getTime();
$scope.mainObj.callback($scope.selctedDateEpoch);
$scope.selectedDateEpoch = newSelectedDate.getTime();
$scope.mainObj.callback($scope.selectedDateEpoch);
}

//Date selected
$scope.dateSelected = function (selectedDate) {
if (!selectedDate || Object.keys(selectedDate).length === 0) return;
$scope.selctedDateEpoch = selectedDate.epoch;
$scope.selectedDateEpoch = selectedDate.epoch;
if ($scope.mainObj.closeOnSelect) {
$scope.mainObj.callback($scope.selctedDateEpoch);
$scope.mainObj.callback($scope.selectedDateEpoch);
if ($scope.mainObj.templateType.toLowerCase() == 'popup') {
$scope.popup.close();
} else {
Expand All @@ -91,16 +91,16 @@ angular.module('ionic-datepicker.provider', [])
$scope.setIonicDatePickerTodayDate = function () {
var today = new Date();
refreshDateList(new Date());
$scope.selctedDateEpoch = resetHMSM(today).getTime();
$scope.selectedDateEpoch = resetHMSM(today).getTime();
if ($scope.mainObj.closeOnSelect) {
$scope.mainObj.callback($scope.selctedDateEpoch);
$scope.mainObj.callback($scope.selectedDateEpoch);
closeModal();
}
};

//Set date for the modal
$scope.setIonicDatePickerDate = function () {
$scope.mainObj.callback($scope.selctedDateEpoch);
$scope.mainObj.callback($scope.selectedDateEpoch);
closeModal();
};

Expand Down Expand Up @@ -192,7 +192,7 @@ angular.module('ionic-datepicker.provider', [])
//Setting up the initial object
function setInitialObj(ipObj) {
$scope.mainObj = angular.copy(ipObj);
$scope.selctedDateEpoch = resetHMSM($scope.mainObj.inputDate).getTime();
$scope.selectedDateEpoch = resetHMSM($scope.mainObj.inputDate).getTime();

if ($scope.mainObj.weeksList && $scope.mainObj.weeksList.length === 7) {
$scope.weeksList = $scope.mainObj.weeksList;
Expand Down Expand Up @@ -255,7 +255,7 @@ angular.module('ionic-datepicker.provider', [])
text: $scope.mainObj.setLabel,
type: 'button_set',
onTap: function (e) {
$scope.mainObj.callback($scope.selctedDateEpoch);
$scope.mainObj.callback($scope.selectedDateEpoch);
}
}];
}
Expand All @@ -267,7 +267,7 @@ angular.module('ionic-datepicker.provider', [])
onTap: function (e) {
var today = new Date();
refreshDateList(new Date());
$scope.selctedDateEpoch = resetHMSM(today).getTime();
$scope.selectedDateEpoch = resetHMSM(today).getTime();
if (!$scope.mainObj.closeOnSelect) {
e.preventDefault();
}
Expand Down