2.0.11 • Published 4 months ago

react-cron-generator v2.0.11

Weekly downloads
818
License
ISC
Repository
github
Last release
4 months ago

react-cron-generator

Simple react component to generate cron expression

Getting Started

Package helps to build linux scheduler cron expression.

npm version Downloads

data = '* * * * * * *'
npm install react-cron-generator

demo

Live demo

alt text

alt text

import React, { Component } from 'react'
import Cron from 'react-cron-generator'
import 'react-cron-generator/dist/cron-builder.css'


class App extends Component {

  constructor(props) {
      super(props);
      this.state = {
       
      };
  }

  render() {
    return (<div>
      <Cron
        onChange={(e)=> {this.setState({value:e});}}
        value={this.state.value}
        showResultText={true}
        showResultCron={true}
        />
                            
    </div>)
  }
}

export default App;

props

PropDescriptionDefaultMandatory
valuecron expressionNo
onChangehave 2 arguments, 1st is cron value and 2nd is cron result text from cronstrueYes
showResultTextshow in readable text formatfalseNo
showResultCronshow cron expressionfalseNo
translateFntranslate function callbackmethodNo
localelocale for cronstrueenNo
optionsOptions for Cron component, *Must pass a valid cron value for available headersAll available headersNo
disabledDisable cron selectorfalseNo

translateFn

Expects a method. Use this prop for localization support. react-cron-generator will call this method for every key. List of keys are available here

locale option should be set for correct ResultText translation. Please visit cronstrue for supported locales.

Options

options.headers

import { HEADER } from 'react-cron-generator';

const options = {
  headers: [HEADER.MONTHLY, HEADER.WEEKLY, HEADER.MINUTES, HEADER.HOURLY, HEADER.DAILY, HEADER.CUSTOM]
};

Release notes 2.x.x

  1. Build Procedure updated
  2. Updated to latest react(18)
  3. Migrated to hooks and typescript

Sojin Antony

"Buy Me A Coffee"

Acknowledgments

cronstrue

Viswanath Lekshmanan

2.0.11

4 months ago

2.0.10

7 months ago

2.0.9

9 months ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.8

1 year ago

2.0.1

2 years ago

2.0.0

2 years ago

1.3.13

2 years ago

1.3.12

2 years ago

1.3.6

2 years ago

1.3.10

2 years ago

1.3.11

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.12

3 years ago

1.2.11

3 years ago

1.2.9

3 years ago

1.2.10

3 years ago

1.2.8

3 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago