You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -51,13 +58,43 @@ $scope.timePickerCallback = function (val) {
51
58
};
52
59
````
53
60
54
-
a) `timePickerCallback` is the callback function which we have to pass to the `ionic-timepicker` directive.
61
+
**$scope.timePickerObject** is the main object, that we need to pass to the directive. The properties of this object are as follows.
62
+
63
+
**a) inputEpochTime**(Optional) : This the input epoch time to which the time will set initially. Default value is current hour. This is mandatory if you wish to show this on the button before opening the popup.
64
+
65
+
**b) step**(Optional) : This the minute increment / decrement step. Default value is `15`
66
+
67
+
**c) format**(Optional) : This the format of the time. It can can two values i.e.`12` or `24`. Default value is `24`
68
+
69
+
**d) titleLabel**(Optional) : The label for `Title` of the popup. Default value is `Time Picker`
70
+
71
+
**e) setLabel**(Optional) : The label for the `Set` button. Default value is `Set`
72
+
73
+
**f) closeLabel**(Optional) : The label for the `Close` button. Default value is `Close`
74
+
75
+
**g) setButtonType**(Optional) : This the type of the `Set` button. Default value is `button-positive`. You can give any valid ionic framework's button classes.
76
+
77
+
**h) closeButtonType**(Optional) : This the type of the `Close` button. Default value is `button-stable`. You can give any valid ionic framework's button classes.
78
+
79
+
**i) callback**(Mandatory) : This the callback function, which will get the selected time in to the controller. You can define this function as follows.
80
+
````javascript
81
+
functiontimePickerCallback(val) {
82
+
if (typeof (val) ==='undefined') {
83
+
console.log('Time not selected');
84
+
} else {
85
+
var selectedTime =newDate(val *1000);
86
+
console.log('Selected epoch is : ', val, 'and the time is ', selectedTime.getUTCHours(), ':', selectedTime.getUTCMinutes(), 'in UTC');
87
+
}
88
+
}
89
+
````
55
90
56
91
5) Then use the below format in your template / html file
0 commit comments