farhoudshapouran/react-native-ui-datepicker

Feature Request: Month / year picker

Opened this issue ยท 3 comments

Request new feature that picker can only max view in month or year

like a initialValue props, but if we click month that will be get data of the month

@devcodemada I recently used this library and could be nice if when I select the month get a onChange function for month and year, and not select the month and then the day.

blazk0 commented

Would be nice to be added, as in my case, i only need to select a month

react-native-ui-datepicker+2.0.4.patch

You can try adding this patch. I added it with a simple implementation.

import Moment from 'moment';
import DateTimePicker from 'react-native-ui-datepicker';

<DateTimePicker
calendarTextStyle={styles.calenderText}
headerTextStyle={styles.headerText}
selectedItemColor={COLOR_PRIMARY}
selectedTextStyle={styles.selectedText}
mode={'single'}
locale={'tr'}
initialView={'month'}
onlyMonth
buttonPrevIcon={()}
buttonNextIcon={()}
firstDayOfWeek={1}
date={start_date}
minDate={this.state.first_date}
maxDate={Moment()}
onChange={({date}) => _onChangeFunction()}
/>