Skip to content

Commit 9b6a004

Browse files
comments added in source code
1 parent a6c6a01 commit 9b6a004

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ionic-timepicker.directive.js

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
var today = new Date();
2121
var currentEpoch = ((new Date()).getHours() * 60 * 60) + ((new Date()).getMinutes() * 60);
2222

23+
//set up base variables and options for customization
2324
scope.inputEpochTime = scope.inputObj.inputEpochTime ? scope.inputObj.inputEpochTime : currentEpoch;
2425
scope.step = scope.inputObj.step ? scope.inputObj.step : 15;
2526
scope.format = scope.inputObj.format ? scope.inputObj.format : 24;
@@ -33,6 +34,7 @@
3334
scope.time = {hours: 0, minutes: 0, meridian: ""};
3435
var objDate = new Date(obj.epochTime * 1000); // Epoch time in milliseconds.
3536

37+
//Increasing the hours
3638
scope.increaseHours = function () {
3739
scope.time.hours = Number(scope.time.hours);
3840
if (obj.format == 12) {
@@ -48,6 +50,7 @@
4850
scope.time.hours = (scope.time.hours < 10) ? ('0' + scope.time.hours) : scope.time.hours;
4951
};
5052

53+
//Decreasing the hours
5154
scope.decreaseHours = function () {
5255
scope.time.hours = Number(scope.time.hours);
5356
if (obj.format == 12) {
@@ -63,22 +66,26 @@
6366
scope.time.hours = (scope.time.hours < 10) ? ('0' + scope.time.hours) : scope.time.hours;
6467
};
6568

69+
//Increasing the minutes
6670
scope.increaseMinutes = function () {
6771
scope.time.minutes = Number(scope.time.minutes);
6872
scope.time.minutes = (scope.time.minutes + obj.step) % 60;
6973
scope.time.minutes = (scope.time.minutes < 10) ? ('0' + scope.time.minutes) : scope.time.minutes;
7074
};
7175

76+
//Decreasing the minutes
7277
scope.decreaseMinutes = function () {
7378
scope.time.minutes = Number(scope.time.minutes);
7479
scope.time.minutes = (scope.time.minutes + (60 - obj.step)) % 60;
7580
scope.time.minutes = (scope.time.minutes < 10) ? ('0' + scope.time.minutes) : scope.time.minutes;
7681
};
7782

83+
//Changing the meridian
7884
scope.changeMeridian = function () {
7985
scope.time.meridian = (scope.time.meridian === "AM") ? "PM" : "AM";
8086
};
8187

88+
//onclick of the button
8289
element.on("click", function () {
8390
if (typeof scope.inputObj.inputEpochTime === 'undefined' || scope.inputObj.inputEpochTime === null) {
8491
objDate = new Date();

0 commit comments

Comments
 (0)