Gathering detailed insights and metrics for rn-datetimepicker-modal
Gathering detailed insights and metrics for rn-datetimepicker-modal
npm install rn-datetimepicker-modal
Typescript
Module System
Node Version
NPM Version
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
1,332
Last Day
2
Last Week
8
Last Month
26
Last Year
196
Latest Version
2.0.9
Package Id
rn-datetimepicker-modal@2.0.9
Unpacked Size
25.00 kB
Size
5.32 kB
File Count
10
NPM Version
8.15.0
Node Version
16.17.0
Publised On
03 Jun 2023
Cumulative downloads
Total Downloads
Last day
-85.7%
2
Compared to previous day
Last week
-46.7%
8
Compared to previous week
Last month
420%
26
Compared to previous month
Last year
-82.7%
196
Compared to previous year
1
4
This library is customized datetimepicker modal for react-native and didn't use other third-party library.
1$ npm install rn-datetimepicker-modal --save
1$ yarn add rn-datetimepicker-modal
1import React from 'react'; 2import DatePickerModal from 'rn-datetimepicker-modal' 3 4class DateModal extends React.Component { 5 6constructor(props) { 7 super(props); 8 this.state = { 9 showDatePicker: false, 10 showTimePicker: false, 11 date: new Date(), 12 fromDate: null, 13 }; 14 } 15 16componentDidMount() { 17 const { date } = this.state; 18 this.setState({fromDate: new Date(date.getFullYear(), date.getMonth(), 1)}); 19} 20 21render() { 22 return ( 23 // implement datepickermodal action 24 // can also set the 25 // minYear => for minimum year 26 // minMonth => for minimum month 27 // done => done text (can use multi translation) 28 // cancel => cancel text (can use multi translation) 29 // doneColor => done text color 30 // borderColor => border color 31 32 <DatePickerModal 33 mode={'date'} // for date picker 34 // for month picker => mode={'month'} 35 maxYear={new Date().getFullYear()} 36 maxMonth={new Date().getMonth() + 1} 37 currentDate={new Date()} 38 visible={this.state.showDatePicker} 39 onCancel={() => this.setState({ showDatePicker: false })} 40 onDone={date => { 41 if (!date) return; 42 this.setState({ fromDate: date }); 43 this.setState({ showDatePicker: false }); 44 }} 45 /> 46 47// for time picker 48 <DatePickerModal 49 currentDate={new Date()} 50 visible={this.state.showTimePicker} 51 onCancel={() => this.setState({ showTimePicker: false })} 52 onDone={date => { 53 if (!date) return; 54 this.setState({ fromDate: date }); 55 this.setState({ showTimePicker: false }); 56 }} 57 /> 58 ); 59} 60} 61export default DateModal;
Date Picker Modal
Month Picker Modal
Time Picker Modal
No vulnerabilities found.
No security vulnerabilities found.