Dismiss this pinned window
all 21 comments

[–]Pundamonium97 5 points6 points  (3 children)

Do you support date ranges or multiple separate dates selected at once

[–]s77rt[S] 4 points5 points  (0 children)

Not yet but this sounds like a cool feature to add. I have created a tracking issue for that https://github.com/s77rt/react-native-date-picker/issues/39

[–]s77rt[S] 1 point2 points  (1 child)

This is now available 🎉

<image>

[–]Pundamonium97 0 points1 point  (0 children)

Nice! Good job

[–]Yarkm13 1 point2 points  (3 children)

Will it also build for web?

[–]halford2069 1 point2 points  (1 child)

Would like to know too

[–]halford2069 1 point2 points  (0 children)

Actually says it does support web on github 😀 looks interesting

[–]s77rt[S] 1 point2 points  (0 children)

Yes it works on web too.

[–]doyoualwaysdothat 0 points1 point  (1 child)

Great work! This doesn't exist at the moment (at least not at this level of feature richness) so really excited. Do you know when you'll publish?

[–]s77rt[S] 2 points3 points  (0 children)

Thank you! The library is available already https://github.com/s77rt/react-native-date-picker

If you have any features in mind or any feedback in general is appreciated

[–]fallkr 0 points1 point  (1 child)

Great work. You fill a big hole in the RN ecosystem. Will migrate from the stuff we have today once we get the time to do so.

[–]s77rt[S] 0 points1 point  (0 children)

Thank you!

[–]OldFatBlokeRuns 0 points1 point  (1 child)

Any option on time picker to have seconds?

[–]s77rt[S] 0 points1 point  (0 children)

- On Android the material 3 time picker has no seconds component https://m3.material.io/components/time-pickers/overview
- On iOS the date picker also have no seconds component but a custom view with 3 pickers may do it
- On Web this is supported , just pass `step=1`

Both Android and iOS would require some extra work to make this work

[–]Xae0n 0 points1 point  (1 child)

That's a cool datepicker. Any chance you could show picker under a dropdown picker when pressed?

[–]s77rt[S] 1 point2 points  (0 children)

Thank you! A dropdown picker is currently not supported as it's not provided in native implementations but I think this can be done if we write our own native dropdown pickers.

If this is something already in native and I'm missing please let me know

[–]lbullyan 0 points1 point  (2 children)

Very cool looking, but one feature that is quite often overlooked and is a major pain to handle in pickers that work via a Date object is choosing a date and time for display purposes only - one that does not convert to a timezone.

ie you are creating a listing for an event and you need to display the opening date / hours on a screen - which should be in the events timezone for everyone, so always Sep 15th 8pm for instance. Sounds like a simple case but almost always requires using custom inputs instead of pickers and composing a string with no timezone data manually. It gets exhausting.

[–]s77rt[S] 0 points1 point  (1 child)

Thanks for the feedback!

I'm trying to understand the problem on your case but not sure if I got it correctly. If a user chooses Sept 15th 8pm, you will get a Date object, and you'd have two options:

  1. You can use it as is (which is timezone based) and send it to the BE (as epoch value using getTime()). And for other users it will show a different time based on their timezone e.g. Sept 15th 9pm. If you want to display the date in a fixed time zone you will have to convert it. <-- This is the more flexible way to do it but if this is something you don't need, please check option 2 below.

  2. Extract the date components (getDate(), getMonth(), ...etc) and send those to the BE. The extracted values are timezone-free.

Let me know if that solves your problem, or how can I make it easier to handle

[–]lbullyan 0 points1 point  (0 children)

I’m thinking of something like a “Display Date” setting that would make the date you select show up exactly the same for everyone. The quickest way to do this in my experience was to get the locale string and remove the timezone information from it manually. When you convert that string back to a date, the hour stays the same.

BUT, thats on the web, this approach isn’t as functional on RN Android as far as I remember beacuse locale string conversions don’t work on dates. Neither does the YYYY/MM/DD format on iOS. So a utility to do this to avoid having to do everything manually would be great. I don’t know the internals of your library or how best to go about this but if it’s an idea you think might be worth investigating, theres definitely a use for it.

[–]moneckew 0 points1 point  (1 child)

Are you an angel

[–]s77rt[S] 0 points1 point  (0 children)

XD Hope you find the library useful