troberts-28 / react-native-timer-picker

A simple, flexible, performant duration picker for React Native apps (Expo & Bare Workflow). Great for timers, alarms and duration inputs. Includes iOS-style haptic and audio feedback.
https://www.npmjs.com/package/react-native-timer-picker
MIT License
142 stars 19 forks source link

Question: option to change the deltas between the values? #38

Closed oferRounds closed 4 days ago

oferRounds commented 2 months ago

For example, make the minutes jump in 15. i.e., 0, 15, 30, 45...

Thank you for this great library!

troberts-28 commented 2 months ago

Hey @oferRounds 👋

Great suggestion! Shouldn't be difficult to make this possible.

I don't have any capacity to work on this until October, but would happily review a PR if you felt like having a go?

oferRounds commented 2 months ago

Cool, sounds good! and thank you for your fast reply. We will try to look into it, and ping you if any questions pop up We‘ll keep you posted Thank you!

cc: @omerToledo

OmerToledo commented 2 months ago

hi @troberts-28 any suggestion how to implement it ? when i try to reach the logic in the node_modules lib i see only dist files and not the actual ts file so its kinda hard to actually test changes and debug it wdyt ?

troberts-28 commented 2 months ago

Hey @OmerToledo!

Ah yeah the ts files aren't bundled into the npm package to keep it as lean as possible.

Follow the README instructions to get a dev version of it set up. It's easiest to use Expo Go on a real device.

You'll want to start by looking at src/components/DurationScroll, in particular the generateNumbers helper function.

Give me a shout if you have any trouble!

troberts-28 commented 4 days ago

Hey all, this feature has just been released in v2.0.0 (see the hourInterval, minuteInterval and secondInterval props).

Thanks again @OmerToledo for the work you did on this 🙌