npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cawfree/react-native-simple-date-picker

v1.0.6

Published

An idiot-proof date picker for React Native.

Downloads

11

Readme

@cawfree/react-native-simple-date-picker

An idiot-proof date picker for React Native, backed by moment.js.

🚀 Getting Started

Using npm:

npm install --save @cawfree/react-native-simple-picker

Using yarn:

yarn add @cawfree/react-native-simple-date-picker

✍️ Example

import React from 'react';
import {
  Platform,
  View,
  StyleSheet,
  Dimensions,
} from 'react-native';
import { ModalProvider } from '@cawfree/react-native-modal-provider';
import MaterialMenuModal from '@cawfree/react-native-modal-provider/RNModalProvider/src/components/MaterialMenuModal';

import SimpleDatePicker from './components/SimpleDatePicker';

const styles = StyleSheet
  .create(
    {
      container: {
        width: 250,
      },
    },
  );

const App = () => (
  <View
    style={styles.container}
  >
    <ModalProvider
      ModalComponent={MaterialMenuModal}
      position={({ x, y, width, height }) => ({
        position: 'absolute',
        left: x,
        // XXX: Apply some additional padding.
        top: y + height + 5,
      })}
    >
    
      <SimpleDatePicker
      />
    </ModalProvider>
  </View>
);

let hotWrapper = () => () => App;
if (Platform.OS === 'web') {
  const { hot } = require('react-hot-loader');
  hotWrapper = hot;
}
export default hotWrapper(module)(App);

📋 Prop Types

| Prop Name | Data Type | Required | Default | Description | |--------------------- |--------------------- |---------- |-------------------------------------------------------------------------------------------------------------------------------------------------- |---------------------------------------------------------------------------------------------------------------------------------- | | Container | propTypes.func | false | ({ children, ...extraProps }) => ( <View {...extraProps} > {children} ) | Defines the React Component instance to use when containing the DatePicker components. | | theme | propTypes.shape({}) | false | { fontSize: 16, color: '#444444', disabledColor: '#CCCCCC', borderRadius: 5, padding: 1, borderWidth: 1, highlightColor: 'blue', } | Defines some style configuration for the . | | date | propTypes.shape | false | undefined | A moment object. Can be used to define the current date to render using the SimpleDatePicker, or can be left null/undefined. | | onDatePicked | propTypes.func | false | moment => null | Callback for when the user has finished selecting a date, or made an update to an existing date and that date is valid. | | minDate | propTypes.shape({}) | false | Moment().subtract(100, 'years') | The minimum allowable selectable date. | | maxDate | propTypes.shape({}) | false | Moment() | The maximum allowable selectable date. | | renderDescription | propTypes.func | false | moment => {moment.format(...)} | A function that can be called to render a React component once a valid date has been selected. |

✌️ License

MIT.