question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

minuteInterval is not working in 'time' mode

See original GitHub issue

Hello, I am using the time picker but the minuteInterval is not working for me both on default and spinner displays.

  const [isTimePickerVisible, setIsTimePickerVisible] = useState(false);
  const [minuteInterval, setMinuteInterval] = useState(5);

 {isTimePickerVisible && (
              <DateTimePicker
                mode="time"
                value={new Date()}
                is24Hour={true}
                minuteInterval={minuteInterval}
                display='default'
                onChange={(event, date) => {
                  setIsTimePickerVisible(false);
                  if (date != undefined) {
                    let hours = date.getHours();
                    let minutes = date.getMinutes();
                    //const seconds = time.getSeconds();
                    if(hours<7 || hours > 16 || (hours === 16 && minutes !== 0))
                    {
                      wrongWorkingHoursAlert();
                    }
                      else{
                    if (hours.toString().length !== 2) hours = "0" + hours;
                    if (minutes.toString().length !== 2)
                      minutes = "0" + minutes;
                    setTimeString(hours + ":" + minutes);
                      }
                  }
                }}
              />
            )}

image

Would like to know if I am doing somthing wrong since I do not see any report about this issue. Thanks.

Using Expo RN Version: 0.62.2 OS: Android emulator and phone ( not checked on ios yet ) Library version: 2.6.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
luancurticommented, Aug 5, 2020

The latest version in the expo is 2.4.3 according this PR and the implementation of the feature is in the 2.5.0 according the CHANGELOG need to update the datetimepicker in the expo to the latest version

0reactions
vonovakcommented, Aug 24, 2020

@spyshower yes, your edit is correct. We cannot control values that can be selected, so we correct the value after selection.

if this does not work for someone, please open a new issue according to the template, thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

minuteInterval is not working in 'time' mode · Issue #238 - GitHub
Hello, I am using the time picker but the minuteInterval is not working for me both on default and spinner displays. const ...
Read more >
Setting CupertinoDatePicker minuteInterval: throws an ...
So to make it work properly as it is now I did add it and initialized it wit DateTime.now() with minutes at 0...
Read more >
GE, 15119 24-Hour Indoor Basic Timer, 1 Polarized Outlet ...
This ItemGE, 15119 24-Hour Indoor Basic Timer, 1 Polarized Outlet, Plug-In, Daily On/Off Cycle, 30 Minute Interval, for Lamps, Seasonal Appliances, and Portable ......
Read more >
Operation Guide 2499/3092 - Support
Changing the Timekeeping Mode setting screen during a 5-minute interval between snooze alarms stops the current snooze alarm operation (but snooze alarm remains....
Read more >
How Does Looping Work? - GoPro Support
Looping will overwrite footage from the same recording but not those ... Looping set to a 20 minute interval will divide your video...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found