timepickerpop icon indicating copy to clipboard operation
timepickerpop copied to clipboard

Changing AM to PM does not display the time correctly in the popup.

Open logicware opened this issue 10 years ago • 3 comments

If I type 06:00 AM in the time field the time in popup is correctly adjusted. If I change the AM in the time field, the popup shows 12:00 PM and further changes to the time don't change the time in the popup unless the PM is changed back to AM.

logicware avatar Oct 08 '14 17:10 logicware

Fixed as follows. Use parseInt to change the hour to number before adding 12. In your version '06' + 12 = '0612', not 18.

if (apm[0].toLowerCase() == 'pm') {
   sp[0] = parseInt(sp[0], 10) + 12;
}

In the process of fixing this, I also added on-change to use ng-change on the time picker.

I like the timepickerpop. A great effort from someone new to AngularJS.

Thanks.

logicware avatar Oct 08 '14 17:10 logicware

Thank you so much you saved my day :) :)

amruth0983 avatar Nov 16 '17 06:11 amruth0983