React-native-jalali-date-picker icon indicating copy to clipboard operation
React-native-jalali-date-picker copied to clipboard

props.day & cant find variable "numbers" problems

Open hossein197176 opened this issue 7 years ago • 0 comments

first issue is solved with passing day={new Date()} as props. but i dont have any idea about second.

constructor(props){
        super(props);
        this.state = {
            date: new Date(),
            prevDay: (d => new Date(d.setDate(d.getDate() - 1)))(new Date()),
            prevDays: (d => new Date(d.setDate(d.getDate() - 1)).toJSON().split('T')[0].replace(/-/g, ''))(new Date()),
        };
    }
    
    render() {
        return (
                <PersianCalendarPicker
                    selectedDate={this.state.date}
                    onDateChange={() => {this.setState({ date })}}
                    minDate={prevDay}
                    prevDays={prevDays}
                    day={new Date()}
                />
        );
    }

hossein197176 avatar Oct 31 '18 16:10 hossein197176