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
132 stars 14 forks source link

onConfirm receives all zero values #26

Closed hugochinchilla closed 3 months ago

hugochinchilla commented 3 months ago

No matter what value I select on the modal, the onConfirm callback always receives all zeros.

This is how I'm using it:

<TimerPickerModal
    visible={showCancelTimePicker}
    initialValue={{
        hours: cancelTime.getHours(),
        minutes: cancelTime.getMinutes(),
        seconds: 0,
    }}
    setIsVisible={setShowCancelTimePicker}
    onConfirm={(pickedDate) => {
        console.warn("SAVING!");
        console.log(pickedDate, "pick");
        setShowCancelTimePicker(false);
    }}
    modalTitle="Margen de cancelación"
    confirmButtonText={"Guardar"}
    hideCancelButton={true}
    onCancel={() => setShowCancelTimePicker(false)}
    closeOnOverlayPress
    hideSeconds={true}
    styles={{
        theme: "light",
    }}
/>
troberts-28 commented 3 months ago

Thank you for reporting this @hugochinchilla. It was a knock-on of a big refactor I did in the previous version.

Now fixed in v1.8.1!

hugochinchilla commented 3 months ago

Thank you, I will try it this weekend and report if I find any problems.