1.0.6 • Published 4 years ago

swipeable-calendar-strip-react-native v1.0.6

Weekly downloads
53
License
MIT
Repository
github
Last release
4 years ago

swipeable-calendar-strip-react-native

React Native library - Swipeable Calendar Strip

Installation

Use npm package manager to install.

npm install swipeable-calendar-strip-react-native

Props

PropsDescriptionTypeDefault
heigthset the height of the calendarnumber75
dayPressedreturn day date format when day is pressedfunction---
showMonthshow or hide month data in headerbooltrue
showYearshow or hide year data in headerbooltrue
activeDayset the active day, accepts Date/Moment date formatfuntion---
startingDateset the starting Datemoment() date formatmoment()
onMountfire funtion when calendar is mountedfunction---
calendarSwipedexectutes when calendar is swiped, give one parameter (number) 0=left 2=rightfuntion---

Style

PropDescriptionTypeDefault
styleStyle the Parrent componentAny---
headerStyleStyle the header, this is necessary for padding of calendar header componentAny---
headerTextStyle color of fontSize of the header textAny---
dateNameStyleStyle for the name of the day in calendar stripAny---
dateNumberStyleStyle for the number of the day in calendar stripAny---
activeDayBorderColorSet the color/width of the ActiveDayBorderString'steelblue'

Usage

import CalendarStrip from "swipeable-calendar-strip-react-native";
import moment from "moment";

const calendar = props => {
   return (
      <CalendarStrip 
        height={75} //height of the strip -- default 75
        dayPressed={(day) => console.log(day)} //executes when day is pressed
        showMonth={true} //accepts boolean -- default = true
        showYear={true} //accepts boolean -- default = true
        startingDate={moment()} //accepts Date or moment date format -- default = moment()
        activeDay={moment().add(1, "days")} //accepts Date/Moment date format
        onMount={() => console.log("calendar did mount")}
        calendarSwiped={(direction) => direction == 0 ? console.log("calendar swiped to left") : console.log("calendar swiped to right")}
      />
   )
}

export default calendar;

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

Licenced under MIT licence