Git Product home page Git Product logo

Comments (12)

bennygenel avatar bennygenel commented on July 22, 2024 3

Hi @mmazzarolo;
I have sort of a problem about this. I changed colors on my theme on native code but it doesn't change your dialogs. If I use react-native DatePickerAndroid and TimePickerAndroid separately it works perfectly but doesn't change when I use yours.

Here is my style.xml

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorAccent">@color/mainRed</item>
    </style>
    <style name="Dialog.Theme" parent="Theme.AppCompat.Light.Dialog">
        <item name="colorAccent">@color/mainRed</item>
    </style>

</resources>

Edit: I found out that if I set react-native DatePickerAndroid mode it doesn't work either. If I don't pass a mode prop it works fine.

What do you think can cause this?

Thanks

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024 1

Hi there,
to style it on Android you should tweak a bit the native code :)

from react-native-modal-datetime-picker.

animeclover avatar animeclover commented on July 22, 2024 1

I try the below blog for adding datePickerAndroid and it's working fine also provide when a user has multiple input field for date solution.

https://infinitbility.com/how-to-add-datepickerandroid-in-react-native-with-color-changes

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024

Hey @bennygenel,

I found out that if I set react-native DatePickerAndroid mode it doesn't work either. If I don't pass a mode prop it works fine.

If you're talking about react-native's own DatePickerAndroid, it is a react-native issue indeed.
Do you mind opening an issue on the react-native official repo?
Feel free to link this issue if needed, I'll leave it open :)
Thank you!

from react-native-modal-datetime-picker.

bennygenel avatar bennygenel commented on July 22, 2024

Hey @mmazzarolo;

Thanks for reopening the issue. I was wondering if it is possible to not provide a mode prop to the DatePickerAndroid if the datePickerModeAndroid prop is omited?

At least this way default DatePickerDialog can be styled correctly.

Thanks again

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024

Could you submit a PR (making sure that it doesn't break anything)?
I'll gladly merge it, but I'd also like to see the issue reported to the react-native official repo (I can do it by myself when I have some spare time if you can't do it!).

Thanks! 👍

from react-native-modal-datetime-picker.

lixiaobin0303 avatar lixiaobin0303 commented on July 22, 2024

Android to get the date is not correct bad day

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024

Closing for inactivity, feel free to post here if you want to discuss this subject further and I'll re-open it! 👨‍💻

from react-native-modal-datetime-picker.

bsonntag avatar bsonntag commented on July 22, 2024

Passing datePickerModeAndroid={'default'} fixes the issue.
@mmazzarolo maybe this should be the default value instead of 'calendar'. What was the reason for using 'calendar' as the default value for this prop?

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024

@bsonntag thank you for investigating on the issue.
Honestly, that prop comes from a previous PR, so I can't really answer your question.
Would you mind submitting a PR for fixing it? :)

from react-native-modal-datetime-picker.

bsonntag avatar bsonntag commented on July 22, 2024

@mmazzarolo done 😉

from react-native-modal-datetime-picker.

annedevia avatar annedevia commented on July 22, 2024

what should i write on onConfirm function when i have 2 inputfields for date picker? please help me

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.