3.2.0 • Published 4 years ago

ziplabs-custom-react-cron v3.2.0

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

custom-react-cron

Simple customizable react component to generate cron expression

Getting Started

Package helps to build linux customized scheduler cron expression. Make sure you have include bootstrap in your project

data = '* * * * * * *'
npm install ziplabs-custom-react-cron

demo

Live demo

alt text

alt text

import React, { Component } from 'react'
import CustomCron from 'ziplabs-custom-react-cron'
import 'ziplabs-custom-react-cron/dist/cron-builder.css'


class App extends Component {

  constructor(props) {
      super(props);
      this.state = {
       
      };
      this.cronStyle = `
        .cron_builder {
          width: 90%;
        }

        .cron_builder_bordering {
          text-align: left;
        }

        .nav-tabs {
          border-bottom: 1px solid #ddd;
        }

        .tab-content>.active {
          display: block;
        }

        .row {
          margin-right: -15px;
          margin-left: -15px;
        }
      `
  }

  render() {
    return (<div>
      <CustomCron
        onChange={(e)=> {this.setState({value:e}); console.log(e)}}
        value={this.state.value}
        tabs={['Daily','Weekly', 'Monthly']}
        hours={2}
        minutes={15}
        style={this.cronStyle}
        showResultText={true}
        showResultCron={true}
        />
                            
    </div>)
  }
}

export default App;

props

PropDescriptionDefault
valuecron expression
onChange
tabsset tabs list'Once', 'Minutes','Hourly','Daily','Weekly', 'Monthly'
stylechange style use existing classes: cron_builder, cron_builder_bordering, nav, nav-tabs, row, well, tab-content, active, col-md-6, col-sm-6
hoursset hours leaps1
minutesset minutes leaps1
showResultTextshow in readable text formatfalse
showResultCronshow cron expressionfalse

Acknowledgments

cronstrue viswanath lakshmanan *Guy Livne https://github.com/glivne-chwy/custom-react-cron

3.2.0

4 years ago

3.1.0

4 years ago

3.0.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.2.0

4 years ago

1.1.2

4 years ago