1.0.22 • Published 1 year ago

react-recurring-job v1.0.22

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

React Recurring Job

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

Getting Started

npm install react-recurring-job

or

if you are installing from github package registry

npm install @fahimkk/react-recurring-job

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.

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

Demo

Live Demo

Image Image

Usage

import Recurrence from 'react-recurring-job';

function App() {
  return (
    <Recurrence
      showFrequency
      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
showFrequencybooleantrueShow frequency selection boxNo
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
import Recurrence from 'react-recurring-job';

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-recurring-job';

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 software licensed under the MIT license.

1.0.22

1 year ago

0.0.22

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

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

1.0.0

1 year ago