Gathering detailed insights and metrics for react-native-tx-modern-datetimepicker
Gathering detailed insights and metrics for react-native-tx-modern-datetimepicker
Gathering detailed insights and metrics for react-native-tx-modern-datetimepicker
Gathering detailed insights and metrics for react-native-tx-modern-datetimepicker
@react-native-community/datetimepicker
DateTimePicker component for React Native
react-native-modal-datetime-picker
A react-native datetime-picker for Android and iOS
react-datetime-picker
A date range picker for your React app.
@storybook/addon-ondevice-controls
Display storybook controls on your device.
A customizable calendar, time & month picker for React Native. Fix bugs and improve for lib: HosseinShabani/react-native-modern-datepicker
npm install react-native-tx-modern-datetimepicker
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
4 Stars
7 Commits
1 Forks
1 Watching
1 Branches
1 Contributors
Updated on 21 Nov 2023
JavaScript (66.38%)
Java (13.5%)
TypeScript (9.56%)
Ruby (4.27%)
Objective-C (4.21%)
Objective-C++ (2.08%)
Cumulative downloads
Total Downloads
Last day
0%
3
Compared to previous day
Last week
142.9%
17
Compared to previous week
Last month
-25%
39
Compared to previous month
Last year
30.9%
555
Compared to previous year
2
1
Forked from HosseinShabani/react-native-modern-datepicker
A customizable calendar, time & month picker for React Native (including Persian Jalaali calendar & locale). For more information, please visit website
npm i react-native-tx-modern-datetimepicker
yarn add react-native-tx-modern-datetimepicker
configs
and options
properties)options
proptextHeaderStyle?: StyleProp<TextStyle>
textHeaderStyle?: StyleProp<TextStyle>
textDayNamesStyle?: StyleProp<TextStyle>
textDayStyle?: StyleProp<TextStyle>
textDaySelectedStyle?: StyleProp<TextStyle>
textTodayStyle?: StyleProp<TextStyle>
textMonthStyle?: StyleProp<TextStyle>
textActionTimeStyle?: StyleProp<TextStyle>
viewDaysNameStyle?: StyleProp<ViewStyle>
viewDaysContainerStyle?: StyleProp<ViewStyle>
viewDayItemStyle?: StyleProp<ViewStyle>
viewDayItemSelectedStyle?: StyleProp<ViewStyle>
viewHeaderItemStyle?: StyleProp<ViewStyle>
viewHeaderContainerStyle?: StyleProp<ViewStyle>
viewButtonActionSelectTimeStyle?: StyleProp<ViewStyle>
viewButtonActionCancelTimeStyle?: StyleProp<ViewStyle>
viewButtonsActionTimeStyle?: StyleProp<ViewStyle>
viewMonthItemSelectedStyle?: StyleProp<ViewStyle>
viewMonthItemStyle?: StyleProp<ViewStyle>
imageArrow?: StyleProp<ImageStyle>
inputYearStyle?: StyleProp<TextInput>
configs
prop: textSeparatorMonthYear
will show ${month}${textSeparatorMonthYear}${year}
in header1import DatePicker, { 2 ModernDateTimePickerConfig, 3 ModernDateTimePickerOptions, 4} from 'react-native-tx-modern-datetimepicker' 5 6const pickerOptions: ModernDateTimePickerOptions = { 7 mainColor: '#0057FF', 8 daysAnimationDistance: 300, 9 headerAnimationDistance: 200, 10 borderColor: '#dde', 11 textDayNamesStyle: { 12 fontWeight: '600', 13 color: '#888', 14 fontSize: 13, 15 }, 16 viewDaysNameStyle: { 17 borderBottomWidth: 3, 18 }, 19 viewHeaderItemStyle: { 20 borderWidth: 1, 21 borderRadius: 16, 22 }, 23 textDayStyle: { 24 fontSize: 15, 25 }, 26 textTodayStyle: { 27 fontSize: 17, 28 fontWeight: '600', 29 }, 30 textHeaderStyle: { 31 fontSize: 17, 32 }, 33 viewMonthItemSelectedStyle: { 34 borderRadius: 16, 35 backgroundColor: '#345678', 36 paddingVertical: 8, 37 }, 38 imageArrow: {}, 39} 40 41// if mode === time or mode === datetimepicker 42// selectedFormat = dateFormat + ' ' + timeFormat (automatic) 43const pickerConfig: ModernDateTimePickerConfig = { 44 dateFormat: 'YYYYMMDD', 45 selectedFormat: 'YYYYMMDD', 46 textSeparatorMonthYear: ' | ', 47 timeFormat: 'HH:mm', 48} 49 50<DatePicker 51 current={'20230608'} // init focus month 52 selected={'20230617 12:18'} // init date and time 53 minimumDate={'20230605'} 54 mode={'dateTimePicker'} 55 minuteInterval={1} 56 onDateChange={(d) => { 57 console.log('onDateChange', d) 58 }} 59 onTimeChange={(d) => { 60 console.log('onTimeChange', d) 61 }} 62 onMonthYearChange={(d) => { 63 console.log('onMonthYearChange', d) 64 }} 65 onSelectedChange={(d) => { 66 console.log('onSelectedChange', d) 67 }} 68 configs={pickerConfig} 69 options={pickerOptions} 70/>
1<DatePicker 2 mode={'time'} 3 minuteInterval={1} 4 onTimeChange={(d) => { 5 console.log('onTimeChange', d) 6 setTimeSelected(d) 7 }} 8 configs={pickerConfig} 9 options={{ 10 ...pickerOptions, 11 viewButtonActionSelectTimeStyle: { 12 backgroundColor: 'green', 13 borderRadius: 8, 14 width: Dimensions.get('window').width - 32, 15 marginHorizontal: 32, 16 justifyContent: 'center', 17 alignItems: 'center', 18 height: 48, 19 }, 20 textActionTimeStyle: { 21 fontSize: 16, 22 fontWeight: '500', 23 }, 24 }} 25/>
1const [visibleModal, setVisibleModal] = useState(false) 2const [dateSelectedModal, setDateSelectedModal] = useState('20230618') 3const [timeSelectedModal, setTimeSelectedModal] = useState('00:00') 4 5<Button title="Show modal" onPress={() => setVisibleModal(true)} /> 6 7<Modal visible={visibleModal} transparent animationType={'slide'}> 8 <View style={{ flex: 1, backgroundColor: '#00000022', justifyContent: 'flex-end' }}> 9 <View style={{ height: 500, backgroundColor: 'white' }}> 10 <DatePicker 11 current={'20230608'} // init focus month 12 selected={`${dateSelectedModal} ${timeSelectedModal}`} // init date and time 13 minimumDate={'20230605'} 14 mode={'dateTimePicker'} 15 minuteInterval={1} 16 onDateChange={(d) => { 17 console.log('onDateChange', d) 18 setDateSelectedModal(d) 19 setVisibleModal(false) 20 }} 21 onTimeChange={(d) => { 22 console.log('onTimeChange', d) 23 setTimeSelectedModal(d) 24 }} 25 onMonthYearChange={(d) => { 26 console.log('onMonthYearChange', d) 27 }} 28 onSelectedChange={(d) => { 29 console.log('onSelectedChange', d) 30 }} 31 configs={pickerConfig} 32 options={pickerOptions} 33 /> 34 <Button title={'Close modal'} onPress={() => setVisibleModal(false)} /> 35 </View> 36 </View> 37</Modal>
No vulnerabilities found.
No security vulnerabilities found.