1.1.4 • Published 1 year ago

react-cron-schedule v1.1.4

Weekly downloads
-
License
Apache License 2....
Repository
github
Last release
1 year ago

React Cron Schedule

A simple and lightweight library for scheduling recurring events in React.

Getting Started

npm install react-cron-schedule

or

if you are installing from github package registry

npm install @qubryx/react-cron-schedule

If the library is not working as expected (Only for the user installed by github package registry), you may need to add the following line to your .npmrc file.

  @qubryx:registry=https://npm.pkg.github.com/qubryx

Demo

Live Demo

Image Image

Usage

import { Recurrence } from 'react-cron-schedule';

function App() {
  return (
    <Recurrence
      onChange={(value) => console.log(value) }
    />
  );
}


export default App;

Props

NamesTypeDefaultDescriptionMandatory
valueobjectFileds in onChange function prop, can use to edit or set default valuesNo
disabledbooleanfalseDisable all fieldsNo
showCronExpressionbooleanfalseShow cron expression of recurring event at the bottomNo
onChangefunctionHave single object argument, which contains user selected settingsNo
stylesobjectReact style objectNo

value props

value prop can be used to pass default values

NamesTypeDefaultDescriptionMandatory
startDateDate/Stringnew Date()The starting date of the recurring eventNo
endDateDate/StringnullThe ending date of the recurring eventNo
repeatString'weekly'The repeating of the reoccurring event. Possible values: "weekly", "monthly".No
frequencyNumber1The interval between each recurrence.No
selectedEndTypeString'noend'The end type of the recurring event. Possible values: "noend", "date", "count"No
endCountNumber10The end count of the recurring eventNo
cronExpressionString''Cron Expression of the recurring event to set the fied values for editingNo
showOnlyBottomBorderBoolean''Show only bottom border for all the box componentsfalse

import { Recurrence } from 'react-cron-schedule';

function App() {
  return (
    <Recurrence
      value = {
        startDate: {new Date()},
        endDate: {new Date(2030, 11, 31)},
        repeat:"weekly"
      }
    />
  );
}


export default App;

CSS

Rule nameDescription
rootstyles applied to root element
frequencyContainerstyles applied to components in frequency row
repeatLabelstyles applied to 'Repeat' text
repeatDropdownstyles applied to repeat selection dropdown
selectedRepeatLabelstyles applied to selected repeat label. Eg: 'week(s)'
frequencyInputstyles applied to frequency number input
weekContainerstyles applied to components in week selection row
weekdayBtnContainerstyles applied to weekday button container
weekdayBtnstyles applied to weekday button
selectedWeekdayBtnstyles applied to selected weekday button
weekdayFullTextLabelstyles applied to weekday full text in mobile view checkbox
selectedWeekdayFullTextLabelstyles applied to selected weekday full text in mobile view checkbox
monthContainerstyles applied to components in month selection row
onLabelstyles applied to 'On' text
dayLabelstyles applied to 'day' text
orLabelstyles applied to 'or' text
dayDropdownstyles applied to day selection dropdown in month. Eg: 1 - 31
orderDropdownstyles applied to order selection dropdown in month: 'First', 'Second', etc
monthWeekdayDropdownstyles applied to weekday selection dropdown in month: 'Monday', 'Day', etc
dateContainerstyles applied to components in date selection row
startLabelstyles applied to 'Start' text
endLabelstyles applied to 'End' text
startDatestyles applied to start date picker
endDatestyles applied to end date picker
endTypestyles applied to end type selection dropdown. Eg: 'date', 'count', etc
endCountstyles applied to end count number input
recurrenceTextstyles applied to recurrenct text
cronExpressionstyles applied to cronExpression text

import { Recurrence } from 'react-cron-schedule';

function App() {
  return (
    <Recurrence
      repeat="weekly"
      styles= {
        repeatDropdown: {
          border: '0px',
          borderBottom: '1px solid',
          paddingBottom: 3
        },
        frequencyInput: {
          border: '0px',
          borderBottom: '1px solid',
          paddingBottom: 3
        },
        weekContainer:{
          marginBottom: 20,
          marginTop: 15
        },
        selectedWeekdayBtn: {
          backgroundColor: 'green'
        },
        dateContainer:{
          marginBottom: 30
        },
        startDate: {
          border: '0px',
          borderBottom: '1px solid',
          paddingBottom: 3
        },
        endDate: {
          border: '0px',
          borderBottom: '1px solid',
          paddingBottom: 3
        },
        endType: {
          border: '0px',
          borderBottom: '1px solid',
          paddingBottom: 3
        },
        recurrenceText: {
          color: 'orange'
        },
      }
    />
  );
}

export default App;

Image

License

React Recurring Job is open-sourced library licensed under the Apache license.

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago