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

@jemmyphan/react-native-day-picker

v1.1.7

Published

react-native-day-picker is a simple calendar which allows you to select date range. Suites for android and ios

Downloads

3

Readme

react-native-day-picker

react-native-day-picker is a simple calendar which allows you select date range. Suites for android and ios.

Demo gif

Getting Started

$ npm install react-native-day-picker --save

Important: When you build app in release mode, calendar works smooth without any lags.

Note: If you use react-native v0.24 or lower install version 1.0.0

Usage

'use strict';

import React from 'react';
import {
    View,
    StyleSheet,
    AppRegistry
} from 'react-native';

import Calendar from './src/Calendar';


class DayPicker extends React.Component {
    render() {
        var from = new Date();
        from.setDate(from.getDate() - 16);
        var to = new Date();

        var startDate = new Date();
        startDate.setMonth(startDate.getMonth() + 1);

        return (
            <View style={styles.container}>
                <Calendar
                    monthsCount={24}
                    startFormMonday={true}
                    startDate={startDate}
                    selectFrom={from}
                    selectTo={to}
                    width={350}
                    onSelectionChange={(current, previous) => {
                        console.log(current, previous);
                    }}
                />
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        paddingTop: 20,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#F5F5F5'
    }
});

Properties

All properties are optional

  • onSelectionChange (func) — Function which will be executed on day click. First param is clicked day date, second one previous clicked day.

  • startDate (Date) — Date from which you can select dates. By default is new Date().

  • width (number) Calendars width, should be divided on 7 without remainder or may cause unpredictable behaviour.

  • selectFrom (Date) — First day in range that will be selected from start.

  • selectTo (Date) — Last day in range that will be selected from start.

  • monthsCount (number) — Count of dates from current months to the last.

  • startFromMonday (bool) — If true than months will started from monday.

  • monthsLocale (arrayOf(string)) — Strings for localization, which will be displayed in month header started from January.

  • weekDaysLocale (arrayOf(string)) — Strings for localization, which will be displayed in week day header, started from sunday.

  • isFutureDate (boolean) — True if you want to select a future date. By default is false.=======

  • rangeSelect (bool) — True if you want to select a range of dates. By default is true.

Colors

  • bodyBackColor (string) — Calendar background color.

  • bodyTextColor (string) — Calendar headers text color.

  • headerSepColor (string) — Calendar header separator color.

  • dayCommonBackColor (string) — Not selected day background color.

  • dayCommonTextColor (string) — Not Selected day text color.

  • dayDisabledBackColor (string) — Disabled day background color.

  • dayDisabledTextColor (string) — Disabled day text color.

  • daySelectedBackColor (string) — First and last day in range background color.

  • daySelectedTextColor (string) — First and last day in range text color.

  • dayInRangeBackColor (string) — In range day background color.

  • dayInRangeTextColor (string) — In range day text color.

  • monthTextColor (string) — Calendar month header text color.

Support

Email [email protected] for support.