Hacker0x01 / react-datepicker

A simple and reusable datepicker component for React
https://reactdatepicker.com/
MIT License
8.06k stars 2.24k forks source link

Time format for time input #1785

Open gmltA opened 5 years ago

gmltA commented 5 years ago

Hi there,

If I'm getting everything right, there is currently no way to customize time input's (showTimeInput) format (currently it is HH:mm aa). Are there any plans to implement this feature?

gautam-pahuja commented 5 years ago

Hi @gmltA It looks like a pretty simple change, you want to submit a PR for that? 😄

gmltA commented 5 years ago

Hello @gautam-pahuja,

Yep, I guess I can.

gautam-pahuja commented 5 years ago

Awesome. Let me know if you face any issue.

Thanks.

wilbertaristo commented 5 years ago

@gautam-pahuja @gmltA hello is this feature available now? been wanting to change the showTimeInput format here...

somecastdev commented 5 years ago

Does this mean that the showTimeInput field is getting the format automatically? Could be why we are getting some mixed results with some users experiencing AM/PM where we expect 24 hour format (Majority is getting 24 hour format).

mmarchuk-jama commented 4 years ago

+1, I'm also running into this issue. I would like to be able to allow 24 hour time format for the time input, but there doesn't seem to be any way to do that. Things I've tried so far:

It seems like the "time select" respects the time format and shows 24 hour options, but the time input remains in the hh:mm a format instead of HH:mm

plushyday commented 4 years ago

same issue

somecastdev commented 4 years ago

I found the reason to why we cannot force the time input format.

The input field is of type time which only follow system locale. Meaning whatever locale we set with date-fns or timeFormat will not change this. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time

oshabaeva commented 4 years ago

Any update on this? Maybe should not use type time?

g-akshay commented 4 years ago

Any updates?

Rubenvdveen commented 4 years ago

This should just use the already existing timeFormat prop in my opinion. Please implement this.

christensenmichael0 commented 4 years ago

This is an enhancement i'd also like to see. Stuck using the time select at the moment.

Kal1na-w commented 4 years ago

Any updates?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kallebornemark commented 3 years ago

Need this!

SergTanchenko commented 3 years ago

need this too

vpetridis commented 3 years ago

need this as well!

fggreen commented 3 years ago

need

oduvanka commented 2 years ago

need

robheerdink commented 2 years ago

any plans to fix this?

neacsugeorge commented 2 years ago

Need this too

jerrylee007 commented 1 year ago

need this too.

Fleurig commented 1 year ago

Need this too

NikolozR commented 4 months ago

Need this

NikolozR commented 4 months ago

timeFormat set to "HH:mm" works for me.