rajeshwarpatlolla/ionic-timepicker

Set time to current time at popup time picker

aishahismail opened this issue · 2 comments

Right now, when I click the button to change the time, the popup showed the current hour, let's say right now is 03:30 PM, but the popup showed only 03:00 PM. So where can I adjust the default time? I had changed it before at .directive, but it still got the same output. Thanks for help.

Yes, it takes the current hour. It won't pick the in between minutes like 3:15 or 3:30 etc. It takes 3:00 or 4:00 etc.

But as per your suggestion i have added that feature, so that it will pick the current time. Let's say if the current time is 13:14, then it will use the same time when you click on the button.

Also you can pass the time as shown below, so that it will pick the current hours and minutes. If ignore this inputEpochTime property then i t will pick the current hours and minutes, but it won't be shown on the button, until you select some time.

$scope.timePickerObject12Hour = {
      inputEpochTime: ((new Date()).getHours() * 60 * 60) + ((new Date()).getMinutes() * 60),  //Optional
      ....
};

Please take a look at this commit

it works! thanks for help