0.0.8 • Published 2 years ago

react-native-timeslots-picker v0.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

React Native Time Slot Picker

npm version downloads MIT License

Simple TimeSlot Picker for React Native.

Requirements

  • React Native 0.60 or higher
  • Moment.js
  • NativeBase

Installation with NPM

npm install react-native-timeslots-picker --save

Installation with Yarn

yarn add react-native-timeslots-picker

Usage

import {TimeSlotPicker} from "react-native-timeslots-picker";

...

const [selectedTimeSlot, setSelectedTimeSlot] = useState(null);

return (
  <Box>
    <TimeSlotPicker
          slotResult={slot => {
            setSelectedTimeSlot(slot);
          }}
          timeSlotInterval={15}
          weekDayFromTime={'08:00'}
          weekDayToTime={'18:00'}
          weekendFromTime={'08:00'}
          weekendToTime={'12:00'}
        />
    <Text>Select Time Slot: {selectedTimeSlot}</Text>
  </Box>
)

Props

PropTypeDefaultDescription
slotResultfunctionnullCallback function to get selected time slot
weekDayFromTimestring'08:00'Weekday start time
weekDayToTimestring'18:00'Weekday end time
weekendFromTimestring'08:00'Weekend start time
weekendToTimestring'12:00'Weekend end time
timeSlotIntervalnumber15Slot interval in minutes
disableHeaderbooleanfalseDisable header shown

Screenshots

Screenshot

License

ISC

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago