5.1.2 • Published 2 years ago

rn-react-native-calendar v5.1.2

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

rn-react-native-calendar

This is a calendar package for react native

Installation

npm install rn-react-native-calendar

Note

Week Calendar Usage

import {WeekCalendar} from "rn-react-native-calendar"


const App =()=>{
    const items = {
        '2022-04-28':{},
        '2022-05-03':{}
    }
    return(
        <View>
            <WeekCalendar items={items} itemsOnThisDate={(items)=>console.log(items)} />
        </View>
    )
}

Screenshot_20220503_185314 (1)

Week Calendar Props

Propdescriptiontypedefualt value
itemsitems which you want to be marked on calendarobject{}
buttonColorcolor on left and right button backgroundstring'#FFEADF'
selectedDateColorselected date background Colorstring'#ff5a3d'
todayDateColortoday's date backgroundColorstring'gray'
itemsOnThisDatecallback which triggers when you click on date with items datafunction(item)=>{ }

CalendarModal Usage

import {CalendarModal} from "rn-react-native-calendar"

const App =()=>{
    const [showCalendar,setShowCalendar] = useState(false)
     const [date,setDate] = useState(new Date())
    const items = {
        '2022-04-28':{},
        '2022-05-03':{}
    }
    const onDayPressChanges = (date)=>{
    
    return(
        <View>
            <CalendarModal 
            items={items}
             currentDate={date} 
            visible={showCalendar} 
            onDayPress={(date)=>onDayPressChanges(date)} 
            onDismiss={()=>setShowCalendar(false)} 
            selectedDateColor={'#ff5a3d'}
            
            />
        </View>
    )
}

CalendarModal Props

Propdescriptiontypedefualt value
itemsitems which you want to be marked on calendarobject{}
visibleshould show calendar modal or notbooleanfalse
selectedDateColorselected date background Colorstring'#ff5a3d'
onDayPresscallback triggered when a day is pressedfunction(data)=>{ }
onDismisscallback which triggers when calendar modal closesfunction()=>{ }

Screenshot_20220503_182451_com example (1) Screenshot_20220503_182454_com example Screenshot_20220503_182459_com example

Contributing

feel free to contribute

License

MIT

5.1.2

2 years ago

5.1.1

2 years ago

5.1.0

2 years ago

5.0.0

2 years ago

4.0.0

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago