hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.6k stars 679 forks source link

New Feature: Add time support #470

Open joeyparis opened 3 years ago

joeyparis commented 3 years ago

Add support for selecting times as well as dates. The addition of times is completely optional and disabled by default, this pull request should have no effect on current behaviors unless the showTimePicker prop is passed.

When showTimePicker is set to true, clicking on either DateInput component will show a dropdown of times in 15-minute increments. If editableDateInputs is true, then more specific times can be set by typing them directly. It's important that when showTimePicker is true that the dateDisplayFormat includes date-fn time formatting options. (e.g. MMM d, yyyy h:mma). If a time format isn't included a console warning will be made.

This also comes with a handful of tests to test basic operation but it is not full coverage.

I also had to change the minimum date-fns version to 2.20.0 as that is the earliest version with the eachMinuteOfInterval function.

Related Issue: #195, #4, and possibly #37.

sdabhi23 commented 3 years ago

Can one of the maintainers please take a look at this?

lyvyu commented 2 years ago

Any progress on this guys ?!

Can anyone take a look at the PR and maybe approve ?!

Thanks in advance.

benjamincharity commented 2 years ago

Bump. This would be a greatly appreciated merge

brent-varga commented 2 years ago

+1

Be happy to contribute as well in merging this feature

StreetHoboSP commented 2 years ago

+1

keremciu commented 2 years ago

this is kinda a good one. We started to merge into TypeScript project but maybe we can consider fundamental changes like this one inside that version

pzipoy commented 2 years ago

Would love to see this. Looking forward to this PR getting reviewed and approved soon.

Weiting-Zhang commented 2 years ago

Hi, @joeyparis Why this PR didn't get merged?

joeyparis commented 2 years ago

@Weiting-Zhang I'm not sure, this community response seems positive. I do see there are some merge conflicts now, but I'm not going to resolve them unless a maintainer confirms this will be merged if they're resolved.

keremciu commented 2 years ago

yeah actually there were discussions about this will be a big change even it's just behind a prop. like this would turn this package into react-datetime-range.

maintainers were discussing a solution about having two different packages in this repository. react-date-range and react-datetime-range, this way we can introduce esbuild setup too but this is a bigger discussion.

I think maybe we can merge this PR into the project and build multiple-package setup later on to give people access to this change.

mjlachman commented 1 year ago

I'd love to see this feature added, too.

sathishkumar16 commented 1 year ago

+1

MladenStojkovic commented 1 year ago

+1 for this. It is greatly needed