1.0.6 • Published 4 years ago

react-cron-jobs v1.0.6

Weekly downloads
30
License
MIT
Repository
github
Last release
4 years ago

react cron jobs

React UI component to create cron expression.

installation

npm install --save react-cron-jobs

demo

Live demo

Usage

import React from 'react';
import './App.css';
import CronJob from 'react-cron-jobs';

class App extends React.Component {

  myCallBackFunc(cronExp, scheduleName) {
    console.log('Cron expression for schedule ' + scheduleName + ' is ' + cronExp);
  }

  render () {
    return(
      <div>
        <CronJob
          getCronExpression={this.myCallBackFunc}
          jobName={'applicationBackup'}>
        </CronJob>
      </div>
    );
  }
}

export default App;

Props

PropTypeDescription
getCronExpressionfunctionUse this callback function to receive the cron expression for the schedule configured.
jobNamestringPass this prop to get the name of the job in the callback function passed as props
frequencystringPass this prop along with prop 'cronString' to load the cronjob UI with this frequency and highlight the selected values
cronStringstringPass this prop along with prop 'frequency' to load the cronjob UI with this cronString and highlight the selected values

License

MIT