Giter Site home page Giter Site logo

Comments (12)

ecmadao avatar ecmadao commented on July 28, 2024 1

It looks like a problem caused by moment-timezone, it return a wrong timezone and change your time by mistake when initial. By the way, it seems works well for me on Safari but broken on Chrome. I'll check it more carefully to see what really happened.

from react-times.

ecmadao avatar ecmadao commented on July 28, 2024 1

I found these issues:

But after I update moment & moment-timezone to the newest version, moment timezone still works wrong. So I publish a new version V2.2.6 to fix this problem occasional: If user give TimePicker an exactly time props, such as "15:15", then I won't moment to guess user's timezone when initial.

Now new version V2.2.6 is already published, so you can update your dependency to check it out. THX!

from react-times.

ecmadao avatar ecmadao commented on July 28, 2024 1

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.

from react-times.

ecmadao avatar ecmadao commented on July 28, 2024 1

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!

from react-times.

ecmadao avatar ecmadao commented on July 28, 2024

Seems a bug. Could you tell me which theme are you using? The Material Theme(default) or the Classic one? And you are using 24 hours mode, right? Thanks for your feedback!

from react-times.

YussufElarif avatar YussufElarif commented on July 28, 2024

I'm using classic theme and using this css
import 'react-times/css/classic/default.css';

P.S

image

    constructor() {
        super();
        this.state = {
            time: '15:15'
        };
    }

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

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

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

Oh, and on initial load, it seems to be adding an extra hour from the time I've written in the state?

from react-times.

YussufElarif avatar YussufElarif commented on July 28, 2024

image

Thank you, that seems to have fixed the issue for the insertion of the initial time. However, selecting 1:00 still renders 13:00.

image

from react-times.

ecmadao avatar ecmadao commented on July 28, 2024

@vemuez
I see. Thank you! It's same problem as the initial one, and I forget to fix it. Now I have published new version V2.2.7 and fixed this problem.

from react-times.

YussufElarif avatar YussufElarif commented on July 28, 2024

Unfortunately, after installing 2.2.7, 1:00 still redirects to 13:00. I would like to contribute too, tried cloning the repository to reproduce the bug and find the problem, but i can't get the branch to work. It's after clicking 1:00am, where timeMode is set to 24, it displays 13:00 instead of 1:00 😢 .

This applies to all the AM times from 1:00am to 11:30am.

  • 1:00 -> 13:00
  • 2:00 -> 14:00
    ...
    ...
  • 11:00 -> 23:00

It converts 24hr AM times to 24hr PM times. I am using the classic theme, and 24 for timeMode.


Here's a quick demo

test

from react-times.

YussufElarif avatar YussufElarif commented on July 28, 2024

Yea, it is as you say. I had already removed the node_modules, upgraded from 2.2.6 to 2.2.7. But it turns out the browser had cached it. Don't know why i didn't think about that sooner. Thank you for the help 😄

from react-times.

YussufElarif avatar YussufElarif commented on July 28, 2024

Well, I've encountered, one more bug in this change actually. 12:00 and 12:30 changes to 00:00 and 00:30.

from react-times.

YussufElarif avatar YussufElarif commented on July 28, 2024

No worries @ecmadao, Thank you for the time to look at this. It works now 😄.

from react-times.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.