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.

Selecting an AM will redirect the datepicker view to a PM for 24h timeMode.

See original GitHub issue

I am using create-react-app as my development template. It has json-loader and i’ve imported everything as per the guide. onTimeChange, it calls a function to set the time to the state, which then feeds back into the TimePicker to via the time prop to update the view.

    handleTimeChange(time) {
        console.log(time)
        this.setState({ time });
    }

    render() {
        const { time } = this.state;

        return (
            <div className="form-group">
                <TimePicker
                    theme="classic"
                    time={time}
                    timeMode="24"
                    onTimeChange={this.handleTimeChange.bind(this)} />
            </div>
        );
    }

The problem comes in when I select the time, such as 1:00. I’ve logged what i get back from the onTimeChange method to compare the results between the view and the console. image

and here is me selecting 13:00 image

both examples change the date picker time to 13:00, i’m just confused as to why it does it on the first one?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ecmadaocommented, Nov 16, 2017

Sorry to reply you late. I had some personal trivia to deal some days ago, and now I’m coming back to fix this issue. First thank you so much for your enthusiasm to help me find these bugs. It’s my fault that now find these problems, and now I make some changes for this module:

  1. If you send time props for react-times component, then when initialize, it won’t use time zone to render current time.
  2. When user chose a time, component will not use time zone either (Cause users know what time they have chosen, so there is need to guess their time zone and recheck the time).
  3. So now, only by sending a timezone props can make component use time zone when render time.

Now I have made a new version 2.2.8 to publish these changes. Would you like to update your dependency and check again? Thanks!

1reaction
ecmadaocommented, Nov 11, 2017

So strange. It worked well for me so I can’t reappearance this bug. But by looking your gif, it really looks like the bug which happened before v2.2.7. Can you reinstall this package, or clean browser cache? Cause it’s only a little change from v2.2.6 to v2.2.7, and maybe node module system or browser cached the required file. It’s only a guess, and I’m still debugging to check if any other bug exist.

Read more comments on GitHub >

github_iconTop Results From Across the Web

24 time in portal date picker - change to am/pm - ServiceNow
I have a date/time picker on one of my catalogue items. It's formatted in 24 hour when the user clicks the clock to...
Read more >
How to change material-ui timepicker to 24 hour format
I have it set to type="time" which allows me to select through times during the day in 12 hours with a AM /...
Read more >
Datepicker am/pm error for 24h time format #5004 - GitHub
When call datepicker i want to see hours range from 00 to 23 (when i have 24h format in settings). Actual behavior: [What...
Read more >
DatePicker AM/PM - Power Platform Community - Microsoft
Solved: Is there a way to change the DatePicker to support 12 hour AM/PM? ... Is it possible to choose AM/PM in a...
Read more >
Advanced Datepicker - Ninja Forms
Documentation on how to use Advanced Datepicker for Ninja Forms. Add customized date/time form fields for scheduling and appointment form options directly ...
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