Skip to content

Commit

Permalink
Merge branch 'Flati-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeshwarpatlolla committed Oct 8, 2015
2 parents ae9293c + e90604f commit 38bb709
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
2 changes: 1 addition & 1 deletion dist/ionic-timepicker.bundle.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 10 additions & 21 deletions src/ionic-timepicker.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@
}
}
if (obj.format == 24) {
if (scope.time.hours != 23) {
scope.time.hours += 1;
} else {
scope.time.hours = 0;
}
scope.time.hours = (scope.time.hours + 1) % 24;
}
scope.time.hours = (scope.time.hours < 10) ? ('0' + scope.time.hours) : scope.time.hours;
};
Expand All @@ -64,33 +60,24 @@
}
}
if (obj.format == 24) {
if (scope.time.hours > 0) {
scope.time.hours -= 1;
} else {
scope.time.hours = 23;
}
scope.time.hours = (scope.time.hours + 23) % 24;
}
scope.time.hours = (scope.time.hours < 10) ? ('0' + scope.time.hours) : scope.time.hours;
};

scope.increaseMinutes = function () {
scope.time.minutes = Number(scope.time.minutes);

if (scope.time.minutes != (60 - obj.step) && (scope.time.minutes + obj.step <= 60)) {
scope.time.minutes += obj.step;
} else {
scope.time.minutes = 0;
}
scope.time.minutes = (scope.time.minutes + obj.step) % 60;

scope.time.minutes = (scope.time.minutes < 10) ? ('0' + scope.time.minutes) : scope.time.minutes;
};

scope.decreaseMinutes = function () {
scope.time.minutes = Number(scope.time.minutes);
if (scope.time.minutes !== 0 && (scope.time.minutes - obj.step >= 0)) {
scope.time.minutes -= obj.step;
} else {
scope.time.minutes = 60 - obj.step;
}

scope.time.minutes = (scope.time.minutes + (60 - obj.step)) % 60;

scope.time.minutes = (scope.time.minutes < 10) ? ('0' + scope.time.minutes) : scope.time.minutes;
};

Expand All @@ -99,7 +86,9 @@
};

element.on("click", function () {
if (scope.inputObj.inputEpochTime) {
if (typeof scope.inputObj.inputEpochTime === 'undefined' || scope.inputObj.inputEpochTime === null) {
objDate = new Date();
} else {
objDate = new Date(scope.inputObj.inputEpochTime * 1000);
}

Expand Down

0 comments on commit 38bb709

Please sign in to comment.