Git Product home page Git Product logo

Comments (12)

mubashiralisiddiqui avatar mubashiralisiddiqui commented on July 22, 2024 1

Need to reopen this issue as its still persist

Having the same issue only on Android with mode "date"
if you try to add the minimumDate props with mode "date" on android App is crashed
working fine on Ios and also working fine with other mode like datetime,time

this will only happen if we passed minimumDate prop on date mode (Android)

"react-native-modal-datetime-picker": "^9.0.0",
"react-native": "0.63.3",

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024

Hi!
What version of RN are you using? Does the bug happens on both iOS and Android?
It sounds more like a bug of react-native's own pickers, could you try to use them and see if they work correctly?
Thanks!

from react-native-modal-datetime-picker.

mkhalil49 avatar mkhalil49 commented on July 22, 2024

Hi,
I use react native 0.43.3
it crashes on both android and ios
when i setted datePickerModeAndroid as spinner works fine on android
also the default react native datePicker android works fine with both calendar and spinner with minDate
I didn't try it yet on ios after i setted datePickerModeAndroid

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024

Does the following example work for you?
Here I'm setting minimumDate with the last picked date from the picker and it is working fine for me (iOS). 🤔

import React, { Component } from 'react';
import { Text, TouchableOpacity, View } from 'react-native';
import DateTimePicker from 'react-native-modal-datetime-picker';
import styles from './app.style';

export default class DateTimePickerTester extends Component {
  state = {
    isDateTimePickerVisible: false,
    minimumDate: new Date(),
  };

  _showDateTimePicker = () => this.setState({ isDateTimePickerVisible: true });

  _hideDateTimePicker = () => this.setState({ isDateTimePickerVisible: false });

  _handleDatePicked = date => {
    console.log('A date has been picked: ', date);
    // Setting the minimumDate as the last picked date
    this.setState({ minimumDate: date });
    this._hideDateTimePicker();
  };

  render() {
    return (
      <View style={styles.container}>
        <TouchableOpacity onPress={this._showDateTimePicker}>
          <View style={styles.button}>
            <Text>Show DatePicker</Text>
          </View>
        </TouchableOpacity>
        <DateTimePicker
          isVisible={this.state.isDateTimePickerVisible}
          onConfirm={this._handleDatePicked}
          onCancel={this._hideDateTimePicker}
          minimumDate={this.state.minimumDate}
        />
      </View>
    );
  }
}

from react-native-modal-datetime-picker.

mkhalil49 avatar mkhalil49 commented on July 22, 2024

Try with setting maximumDate with minimumDate

from react-native-modal-datetime-picker.

mkhalil49 avatar mkhalil49 commented on July 22, 2024

my code works on ios and android after i setted datePickerModeAndroid as spinner

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024

Try with setting maximumDate with minimumDate

I did, it's working fine.

my code works on ios and android after i setted datePickerModeAndroid as spinner

That's weird, because datePickerModeAndroid is not even checked by iOS, maybe it was a caching issue?

from react-native-modal-datetime-picker.

mkhalil49 avatar mkhalil49 commented on July 22, 2024

My code still gives error when I remove datePickerModeAndroid on android and ios
but I can't reproduce and I tried Your code is working fine
I tried it with resetting minimumDate dynamically and also work fine
so thank You a lot if You want You can close this issue

from react-native-modal-datetime-picker.

mmazzarolo avatar mmazzarolo commented on July 22, 2024

Feel free to re-open if you'll be able to reproduce it!

from react-native-modal-datetime-picker.

lavarajallu avatar lavarajallu commented on July 22, 2024

Hello, @arabscimitar Actually I am using this module .
My ```
"react": "16.0.0-alpha.12",
"react-native": "0.46.1",

But, 
you are saying that to change react-native version 0.43.3. 
But I am using another module 
urban airship But it's accepts  react-native-version>= 0.44.0,
what can I do But i want to show an ,
datePickerModeAndroid={'spinner'}

from react-native-modal-datetime-picker.

mkhalil49 avatar mkhalil49 commented on July 22, 2024

i could not reproduce i am not sure why it is happens

from react-native-modal-datetime-picker.

lavarajallu avatar lavarajallu commented on July 22, 2024

But I want Spinner Mode in android but it shows default mode

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.