Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24 hrs format not working properly #101

Open
ilahir opened this issue Oct 6, 2016 · 7 comments
Open

24 hrs format not working properly #101

ilahir opened this issue Oct 6, 2016 · 7 comments

Comments

@ilahir
Copy link

ilahir commented Oct 6, 2016

Hi,
24 hrs format not working properly in end hours (55 mins like that)

For Ex : current time is 5:55 PM

show time picker 18:55 like that

@rajeshwarpatlolla
Copy link
Owner

Can you show me the steps to reproduce this issue?

@ilahir
Copy link
Author

ilahir commented Oct 6, 2016

Hi,
Please change the system time (For Ex : 10:50 PM)

http://rajeshwarpatlolla.github.io/TimePickerForIonicFramework/demo/#/tab/timepicker

see below image
System time is 10:46 PM
Open your demo time picker and see the time in 24 format (show 23:45 this wrong ---> correct time is 22:45)

img_20161006_224627

@ilahir
Copy link
Author

ilahir commented Oct 7, 2016

Hi,
Fixed above issues in 24 hrs format

added parseInt, see below code

function o(i, e) {
r.time.hours =parseInt(i / 3600);
var t = i % 3600;
12 == e && (r.time.hours > 12 ? (r.time.hours -= 12, r.time.meridian = "PM") : r.time.meridian = "AM"), r.time.minutes = t / 60, r.time.hours = r.time.hours.toFixed(0), r.time.minutes = r.time.minutes.toFixed(0), 1 == r.time.hours.toString().length && (r.time.hours = "0" + r.time.hours), 1 == r.time.minutes.toString().length && (r.time.minutes = "0" + r.time.minutes), r.time.format = r.mainObj.format
}

@jyotigupta007
Copy link

Hi,

I am also facing the same issue. 24 hrs format not working properly in end hours like after 30 minutes it shows 1 hour more in time picker.

@ilahir
Copy link
Author

ilahir commented Dec 28, 2016 via email

@jyotigupta007
Copy link

jyotigupta007 commented Dec 29, 2016

Hi Ilahir,

I have changed in min file as you have mentioned in your above comment. And it is working fine.

Thanks for your help.

@rajeshwarpatlolla
Copy link
Owner

Can someone make a PR with the fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants