I am currently using the ionic-timepicker plugin to create a time collector for my ionic application.
Unfortunately, I am having problems setting the current time to default and updating the value when the user makes a choice.
Can someone please help me figure out what is wrong?

controller.js
$scope.appointmentTime = ((new Date()).getHours() * 60 * 60);
$scope.timePickerObject = {
inputEpochTime: ((new Date()).getHours() * 60 * 60),
step: 15,
format: 12,
titleLabel: '12-hour Format',
setLabel: 'Set',
closeLabel: 'Close',
setButtonType: 'button-positive',
closeButtonType: 'button-stable',
callback: function(val) {
timePickerCallback(val);
}
};
function timePickerCallback(val) {
if (val) {
$scope.timePickerObject.inputEpochTime = val;
}
}
book.html
<ionic-timepicker input-obj="timePickerObject">
<button class="button button-block button-positive overflowShow" style="margin-top: 0px; margin-bottom: 0px">
<standard-time-meridian etime='timePickerObject.appointmentTime'></standard-time-meridian>
</button>
</ionic-timepicker>
source
share