Git Product home page Git Product logo

Comments (10)

mmazzarolo avatar mmazzarolo commented on July 22, 2024 2

Landed on v4.11.0

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024 1

Nice to know, I'll release it on npm soon then :)

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024

Sorry for being late, I was on holiday.
I'll take a look at it as soon as I can.

from react-native-modal-datetime-picker.

j-wang avatar j-wang commented on July 22, 2024

Confirmed that I'm seeing the same problem. I'm on 4.5.0.

Working great for iOS, but exhibiting this reset behavior for Android (though it also works the other way around for meβ€”mode="date" resets the time portion to 12am, at least on is24Hour={false}).

from react-native-modal-datetime-picker.

j-wang avatar j-wang commented on July 22, 2024

I also confirmed it for 4.9.0 on my code as well.

For my case, since I'm not using datetime mode, it's when moment({...}).toDate() generates a date with the incorrect elements for the time or date in _showDatePickerAndroid and _showTimePickerAndroid respectively.

I opened a pull request with a somewhat brute force solution to it by just repulling the missing datetime elements from this.props.date. This fixes it in my app, though inelegant. There's probably a better way of handling this, but I haven't spent enough time looking through the rest of the code, since this was a quick-fix for an app update for me.

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024

Thank you for the contribution @j-wang
@jkdf2 could you give @j-wang solution a try?
I'm sorry guys but I still haven't had a chance to take a serious look at it (I'm always following the issues and PRs though), but the proposed solution seems to be more than enough in my opinion.

from react-native-modal-datetime-picker.

taylorkline avatar taylorkline commented on July 22, 2024

I am no longer working on a react-native project and will be unable to give feedback at this time. Thank you for your contribution @j-wang!

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024

In the meanwhile, I merged the PR (I gave it a quick test and it worked).
Anyone else available for testing it a bit more?
@j-wang are you still using it without any issue?

from react-native-modal-datetime-picker.

j-wang avatar j-wang commented on July 22, 2024

Thanks, @mmazzarolo! Yeah, still using it in production, passed our blackbox tests, and no end users have complained so far, so seems to be working fine.

from react-native-modal-datetime-picker.

erikaxel avatar erikaxel commented on July 22, 2024

Hi, I can also confirm this works for me and fixes the bug. Looking forward to the npm release!

from react-native-modal-datetime-picker.

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.