Giter Site home page Giter Site logo

react-native-jumpable-calendar's Introduction

react-native-jumpable-calendar

React Native calendar component for both Android and iOS. Users can use dropdown list to jump to any month in the range

Install

npm install react-native-jumpable-calendar --save

Example

ios

Usage

import React, { Component } from 'react'
import Calendar from 'react-native-jumpable-calendar'

class _NewCalendar extends Component {
  constructor(props) {
    super(props);
    this.state = {
      currentMonth: new Date().getMonth(),
      currentYear: new Date().getFullYear(),
      markedDates: {
        "2019-05-16": { selected: true, marked: true, selectedColor: "orange" },
        "2019-05-06": { selected: true, marked: true, selectedColor: "blue" },
        "2019-05-01": { selected: true, marked: true, selectedColor: "green" },
        "2019-05-17": { marked: true },
        "2019-06-18": { marked: true, dotColor: "red", activeOpacity: 0 },
        "2019-08-19": { disabled: true, disableTouchEvent: true },
      },
    };
  }
  render() {
    return (
        <View style={styles.calendarWrapper}>
          <Calendar
            pagingEnabled={true}
            scrollEnabled={true}
            pastScrollRange={50}
            futureScrollRange={50}
            showTodayButton={true}
            showMonthChooser={true}
            calendarWidth={300}
            onDayPress={day => {
              console.warn("day", day);
            }}
            markedDates={this.state.markedDates}
          />
        </View>
    );
  }
}

Properties

Prop Default Type Description
currentDate today string Specify current date eg:'2018-08-08'
pastScrollRange 50 number Max amount of months allowed to scroll to the past
futureScrollRange 50 number Max amount of months allowed to scroll to the future.
scrollEnabled true boolean Enable or disable scrolling of calendar list
showScrollIndicator false boolean Enable or disable vertical scroll indicator.
scrollsToTop true boolean When true, the calendar list scrolls to top when the status bar is tapped.
pagingEnabled true boolean Enable or disable paging on scroll
calendarWidth device width number Specify the width of this calendar component
showMonthChooser false boolean Controller whether or not display monthChooser.
showTodayButton true boolean Controller whether or not display today button.
showCalendarTextHeader false boolean Controller whether or not display static calendar text header.
dayTextArr ["Sun"..."Sat"] array Restricts the range of possible date values.
markedDates {} object Collection of dates that have to be marked.
dropdownStyle - object The hook of customize dropdown style.
dropdownListTextStyle - object The hook of customize dropdown style.
dropdownSelectionStyle - object The hook of customize dropdown style.
disabledDropdownListStyle - object The hook of customize dropdown style.
dropdownMenuStyle - object The hook of customize datepicker dropdown.
disabledDropdownMenuTextStyle - object The hook of customize dropdown style.
dropdownMenuTextStyle - object The hook of customize dropdown style.
dropdownTextHighlightStyle - object The hook of customize dropdown style.

react-native-jumpable-calendar's People

Contributors

dependabot[bot] avatar johowoo avatar

Stargazers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.