react-native-notag-datepicker

0.0.1 • Public • Published

React Native DatePicker

A React Native DatePicker without Tag

based on: Cordova DatePicker Plugin

origin ios https://github.com/sectore/phonegap3-ios-datepicker-plugin

example code

import {
  NativeEventEmitter,
  NativeModules
} from 'react-native';

const DatePickerHandler = {};
const RNNoTagDatepicker = NativeModules.RNNoTagDatepicker;

const DatePickerEvent = new NativeEventEmitter(NativeModules.RNNoTagDatepicker);

DatePickerEvent.addListener('DATEPICKER_NATIVE_INVOKE', (evt: Event) => {
if(evt.status === 'success') {
  const toMSUnit = parseFloat(evt.value) * 1000;
  const date =  new Date(toMSUnit);
  webView.postMessage(JSON.stringify({
    type: 'DATE_PICKER',
    success: true,
    date
  }));
}
});

const showPicker = async (options) => {
  RNNoTagDatepicker.show(options);
};

showPicker({
  date: payload.date,
  maxDate: payload.maxDate,
});

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i react-native-notag-datepicker

Weekly Downloads

0

Version

0.0.1

License

none

Last publish

Collaborators

  • phodal