Code Monkey home page Code Monkey logo

awrminkhodaei / react-native-horizontal-datepicker Goto Github PK

View Code? Open in Web Editor NEW
18.0 1.0 1.0 5.33 MB

Gregorian and Jalali customizable date picker as a horizontal timeline. inspired by @sobimor

Home Page: https://www.npmjs.com/package/@awrminkhodaei/react-native-horizontal-datepicker

License: MIT License

JavaScript 6.17% Java 26.12% TypeScript 38.78% Swift 0.30% C 0.43% Objective-C 13.36% Ruby 14.84%
reactnative datepicker reactnative-ui jalali-date-picker gregorian-datepicker component react picker react-native

react-native-horizontal-datepicker's Introduction

react-native-horizontal-datepicker

Jalali and gregorian react native horizontal datepicker ๐Ÿ”ฅ

@awrminkhodaei/react-native-horizontal-datepicker

React native horizontal date picker - Animated gif demo

Installation

npm install @awrminkhodaei/react-native-horizontal-datepicker

or

yarn add @awrminkhodaei/react-native-horizontal-datepicker

Usage

import HorizontalDatepicker from '@awrminkhodaei/react-native-horizontal-datepicker';

// ...

<HorizontalDatepicker
  mode="gregorian"
  startDate={new Date('2020-08-20')}
  endDate={new Date('2020-08-31')}
  initialSelectedDate={new Date('2020-08-22')}
  onSelectedDateChange={(date) => setSelectedDate(date)}
  selectedItemWidth={170}
  unselectedItemWidth={38}
  itemHeight={38}
  itemRadius={10}
  selectedItemTextStyle={styles.selectedItemTextStyle}
  unselectedItemTextStyle={styles.selectedItemTextStyle}
  selectedItemBackgroundColor="#222831"
  unselectedItemBackgroundColor="#ececec"
  flatListContainerStyle={styles.flatListContainerStyle}
/>;

Props

  • mode (String) : defines datepickers mode, jalali | gregorian
  • startDate (Date): starting date of picker, ex: startDate= new Date('2020-12-01')
  • endDate (Date): ending date of picker, ex: endDate= new Date('2020-12-10')
  • onSelectedDateChange (Function): callback when pressing an item on picker with selectedDate value
  • initialSelectedDate (Date): sets default selected item on picker
  • selectedItemWidth (Number): width of selected item on picker defaults to 170
  • unselectedItemWidth (Number): width of unselected item on picker defaults to 38
  • itemHeight (Number): sets all items height on picker defaults to 38
  • itemRadius (Number): sets all items radius on picker defaults to 10
  • selectedItemTextStyle (TextStyle): selected items text style, ex: selectedItemTextStyle={{fontFamily: 'nunito'}}
  • unselectedItemTextStyle (TextStyle): unselected items text style, ex: selectedItemTextStyle={{fontFamily: 'nunito'}}
  • selectedItemBackgroundColor (String): sets selected items background color, defaults to #16213e
  • unselectedItemBackgroundColor (String): sets unselected items background color, defaults to #fff
  • flatListContainerStyle (ViewStyle): sets contentContainerStlye of FlatList containg date items

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

react-native-horizontal-datepicker's People

Contributors

awrminkhodaei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

fusion-second

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.