Socket
Socket
Sign inDemoInstall

@uplet/react-native-dayview-calendar

Package Overview
Dependencies
529
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @uplet/react-native-dayview-calendar

React native day view calendar


Version published
Maintainers
2
Install size
11.5 MB
Created

Readme

Source

Haul

React Native DayView Calendar


DayView Calendar is a react-native, themable, animated calendar that display carousel of days with possibility to add, remove or resize events.

Features

  • Events are addable, removable, resizable and movable
  • Carousel of days
  • Themable
  • Customisable

Getting started

Start by adding @uplet/react-native-dayview-calendar as a dependency to your React Native project (use react-native init MyProject to create one if you don't have a project):

yarn add @uplet/react-native-dayview-calendar
or
npm install @uplet/react-native-dayview-calendar

Documentation

Default component to use is<DaysCalendar />

Example

import DaysCalendar from "@uplet/react-native-dayview-calendar"
<DaysCalendar
    date={'28-01-2019'}
    disabledDates={() => {}}
    dayStartShift={6}
    dateRange={365}
    interval={30}
    events={(date: string) => {
      ...
    }}
    onDateChangeEvent={(date, { id }, startDate, endDate) => {
      ...
    }}
    onCreateEvent={(date, startDate, endDate) => {
      ...
    }}
    onDeleteEvent={(date, { id }) => {
      ...
    }}
  />

Props


onCreateEvent

Callback that is triggered when event should be created

(date, startTime, endTime) => void;
TypeRequired
functionYes

onDateChangeEvent

Callback that is triggered when event changes it's date

(date, event, startTime, endTime) => void;
TypeRequired
functionYes

onDeleteEvent

Callback that is triggered when event should be deleted

(date, event) => void;
TypeRequired
functionYes

onDayChangeEvent

Callback that is triggered when active day changed

(day) => void;
TypeRequired
functionYes

date

Start Day, default is today

TypeRequired
stringNo

disabledDates

Function that returns disabled dates for given day;

day => Array<{startDate, endDate}>
TypeRequired
functionNo

events

Function that returns event dates for given day;

day => Array<{startDate, endDate}>
TypeRequired
functionNo

dateRange

How many days user will be able to swipe calendar. By default it's 365

TypeRequired
numberNo

windowSize

How many days out of the screen should be rendered in advance

TypeRequired
numberNo

calendarRecreateTreshold

Percentage of the calendar days. If there is less days left after scroll it forces re-create calendar with new date

TypeRequired
numberNo

theme

Set of styles properties that can customize the calendar appearance

{
  accentColor, //used for event span trash icon and points used for resize
  accentBackgroundColor, //color of event span
  backgroundColor, //calendar background color
  timeIndicator, // color of line that indicates current hour
  labelColor, // color of labels ( i.e "11 AM")
  minuteSplitColor, // color of line that split minutes
  hourSplitColor, //color of line that split hours
  disabledColor, // color of lines displaying disable dates
}
TypeRequired
objectNo

disablePast

Whether calendar should allow to swipe to the past

TypeRequired
booleanNo

customStartPosition

Should scroll to current time on each day

TypeRequired
booleanNo

customStartPositionOffset

custom offset for custom start postion

TypeRequired
numberNo

Publishing

First you need to have access to uplet organization on npm. Ask Harris for it.

Use one of the following yarn commands to publish package

yarn release  #Release package with latest tag (This package will be used by default by 'yarn add' command)
yarn release:next  #Release package with next tag
yarn release:beta #Release package with beta tag (use for testing calendar features)

Made with ❤️ at Uplet

DayView calendar is an open source project. If you like it, please star it 🌟.

FAQs

Last updated on 10 Feb 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc