diff --git a/src/components/ReactCron/ReactCron.js b/src/components/ReactCron/ReactCron.js
index e8f250e8..08b21f96 100644
--- a/src/components/ReactCron/ReactCron.js
+++ b/src/components/ReactCron/ReactCron.js
@@ -26,7 +26,7 @@ const steps = [
title: 'Month',
content: 'month',
},
-];
+]
class ReactCron extends React.Component {
constructor(props) {
@@ -38,49 +38,49 @@ class ReactCron extends React.Component {
cornFormat: false,
current: 0,
activeKey: 'Cron',
- second:{
+ second: {
cronEvery: '1',
incrementStart: 3,
incrementIncrement: 5,
rangeStart: 1,
rangeEnd: 0,
- specificSpecific:[],
+ specificSpecific: [],
},
minutesText: '*',
minutesValue: null,
- minutes:{
+ minutes: {
cronEvery: '1',
incrementStart: 3,
incrementIncrement: 5,
rangeStart: 0,
rangeEnd: 0,
- specificSpecific:[],
+ specificSpecific: [],
},
hourText: '*',
hourValue: null,
- hour:{
+ hour: {
cronEvery: '1',
incrementStart: 3,
incrementIncrement: 5,
rangeStart: 0,
rangeEnd: 0,
- specificSpecific:[],
+ specificSpecific: [],
},
dayText: '*',
dayValue: null,
- day:{
+ day: {
cronEvery: '1',
incrementStart: 1,
incrementIncrement: 1,
rangeStart: 1,
rangeEnd: 0,
- specificSpecific:[],
+ specificSpecific: [],
cronLastSpecificDomDay: '1L',
cronDaysBeforeEomMinus: 1,
cronDaysNearestWeekday: 1,
},
weekText: '?',
- week:{
+ week: {
cronEvery: '',
incrementStart: '1',
incrementIncrement: '1',
@@ -90,25 +90,26 @@ class ReactCron extends React.Component {
},
monthText: '*',
monthValue: null,
- month:{
+ month: {
cronEvery: '1',
incrementStart: 3,
incrementIncrement: 5,
rangeStart: 1,
rangeEnd: 1,
- specificSpecific:[],
+ specificSpecific: [],
},
yearText: '*',
- year:{
+ year: {
cronEvery: '1',
incrementStart: 1,
incrementIncrement: 2019,
rangeStart: 2019,
rangeEnd: 2019,
- specificSpecific:[],
+ specificSpecific: [],
},
}
}
+
componentDidMount() {
let cornText = this.props.cron ? this.props.cron : `${this.state.minutesText} ${this.state.hourText} ${this.state.dayText} ${this.state.monthText} ${this.state.weekText}`
let prettyCronText = prettyCron.toString(cornText)
@@ -117,7 +118,7 @@ class ReactCron extends React.Component {
cornText,
prettyCronText,
}, () => {
- if( !cronValidate(cornText) ) {
+ if (!cronValidate(cornText)) {
this.setState({
...this.state,
cornFormat: true,
@@ -141,7 +142,7 @@ class ReactCron extends React.Component {
cornText,
prettyCronText,
}, () => {
- if( !cronValidate(cornText) ) {
+ if (!cronValidate(cornText)) {
this.setState({
...this.state,
cornFormat: true,
@@ -156,12 +157,13 @@ class ReactCron extends React.Component {
}
})
}
- /*second*/
+
+ /* second */
secondOnChange = (val) => {
let seconds = '*'
- let cronEvery= val.target ? val.target.value : val
- let data = Object.assign({}, this.state.second, {cronEvery: cronEvery.toString()})
- switch (cronEvery.toString()){
+ let cronEvery = val.target ? val.target.value : val
+ let data = Object.assign({}, this.state.second, { cronEvery: cronEvery.toString() })
+ switch (cronEvery.toString()) {
case '1':
this.setState({
...this.state,
@@ -171,7 +173,7 @@ class ReactCron extends React.Component {
this.prettyCronfun()
break
case '2':
- seconds = this.state.second.incrementStart+'/'+this.state.second.incrementIncrement
+ seconds = `${this.state.second.incrementStart}/${this.state.second.incrementIncrement}`
this.setState({
...this.state,
secondText: seconds,
@@ -180,10 +182,10 @@ class ReactCron extends React.Component {
this.prettyCronfun()
break
case '3':
- if(this.state.second.specificSpecific.length > 0){
+ if (this.state.second.specificSpecific.length > 0) {
seconds = ''
- this.state.second.specificSpecific.forEach(val=> {
- seconds += val+','
+ this.state.second.specificSpecific.forEach(val => {
+ seconds += `${val},`
})
seconds = seconds.slice(0, -1)
}
@@ -195,7 +197,7 @@ class ReactCron extends React.Component {
this.prettyCronfun()
break
case '4':
- seconds = this.state.second.rangeStart+'-'+this.state.second.rangeEnd
+ seconds = `${this.state.second.rangeStart}-${this.state.second.rangeEnd}`
this.setState({
...this.state,
secondText: seconds,
@@ -203,30 +205,30 @@ class ReactCron extends React.Component {
})
this.prettyCronfun()
break
- default :
+ default:
break
}
}
- secondMultipleChange = (valArr)=> {
+ secondMultipleChange = (valArr) => {
let seconds = '*'
- if(valArr.length > 0){
+ if (valArr.length > 0) {
seconds = ''
valArr.forEach(val => {
- seconds += val+','
+ seconds += `${val},`
})
seconds = seconds.slice(0, -1)
}
- let data = Object.assign({}, this.state.second, { specificSpecific: valArr, secondText: this.state.second.cronEvery === '3' ? seconds : this.state.secondText })
- this.setState({...this.state, secondText: data.secondText, second: data })
+ let data = Object.assign({}, this.state.second, { specificSpecific: valArr, secondText: this.state.second.cronEvery === '3' ? seconds : this.state.secondText })
+ this.setState({ ...this.state, secondText: data.secondText, second: data })
}
- /*minutes*/
+ /* minutes */
minutesOnChange =(val) => {
let minutes = '*'
- let cronEvery= val.target ? val.target.value : val
- let data = Object.assign({}, this.state.minutes, {cronEvery: cronEvery.toString()})
- switch (cronEvery.toString()){
+ let cronEvery = val.target ? val.target.value : val
+ let data = Object.assign({}, this.state.minutes, { cronEvery: cronEvery.toString() })
+ switch (cronEvery.toString()) {
case '1':
this.setState({
...this.state,
@@ -238,12 +240,12 @@ class ReactCron extends React.Component {
dayText: '*',
weekText: '?',
minutes: data,
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
case '2':
- minutes = this.state.minutes.incrementIncrement + '/' + this.state.minutes.incrementStart
+ minutes = `${this.state.minutes.incrementIncrement}/${this.state.minutes.incrementStart}`
this.setState({
...this.state,
minutesText: minutes,
@@ -254,10 +256,10 @@ class ReactCron extends React.Component {
})
break
case '3':
- if(this.state.minutes.specificSpecific.length > 0){
+ if (this.state.minutes.specificSpecific.length > 0) {
minutes = ''
- this.state.minutes.specificSpecific.forEach(val=> {
- minutes += val+','
+ this.state.minutes.specificSpecific.forEach(val => {
+ minutes += `${val},`
})
minutes = minutes.slice(0, -1)
}
@@ -271,7 +273,7 @@ class ReactCron extends React.Component {
})
break
case '4':
- minutes = this.state.minutes.rangeStart + '-' + this.state.minutes.rangeEnd
+ minutes = `${this.state.minutes.rangeStart}-${this.state.minutes.rangeEnd}`
this.setState({
...this.state,
minutesText: minutes,
@@ -281,30 +283,30 @@ class ReactCron extends React.Component {
this.prettyCronfun()
})
break
- default :
+ default:
break
}
}
- minutesMultipleChange = (valArr)=> {
+ minutesMultipleChange = (valArr) => {
let minutes = '*'
- if(valArr.length > 0){
+ if (valArr.length > 0) {
minutes = ''
- valArr.forEach(val=> {
- minutes += val+','
+ valArr.forEach(val => {
+ minutes += `${val},`
})
minutes = minutes.slice(0, -1)
}
- let data = Object.assign({}, this.state.minutes, { specificSpecific: valArr, minutesText: this.state.minutes.cronEvery === '3' ? minutes : this.state.minutesText })
- this.setState({...this.state, minutesText: data.minutesText, minutes: data }, () => { this.prettyCronfun() })
+ let data = Object.assign({}, this.state.minutes, { specificSpecific: valArr, minutesText: this.state.minutes.cronEvery === '3' ? minutes : this.state.minutesText })
+ this.setState({ ...this.state, minutesText: data.minutesText, minutes: data }, () => { this.prettyCronfun() })
}
- /*hour*/
+ /* hour */
hourOnChange =(val) => {
let hour = '*'
- let cronEvery= val.target ? val.target.value : val
- let data = Object.assign({}, this.state.hour, {cronEvery: cronEvery.toString()})
- switch (cronEvery.toString()){
+ let cronEvery = val.target ? val.target.value : val
+ let data = Object.assign({}, this.state.hour, { cronEvery: cronEvery.toString() })
+ switch (cronEvery.toString()) {
case '1':
this.setState({
...this.state,
@@ -314,12 +316,12 @@ class ReactCron extends React.Component {
minutesValue: this.state.minutesText === '*' ? null : this.state.minutesValue,
dayValue: null,
hour: data,
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
case '2':
- hour = this.state.hour.incrementIncrement + '/' + this.state.hour.incrementStart
+ hour = `${this.state.hour.incrementIncrement}/${this.state.hour.incrementStart}`
this.setState({
...this.state,
hourText: hour,
@@ -327,15 +329,15 @@ class ReactCron extends React.Component {
minutesText: this.state.minutesText === '*' ? '0' : this.state.minutesText,
minutesValue: this.state.minutesText === '*' ? null : this.state.minutesValue,
hour: data,
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
case '3':
- if(this.state.hour.specificSpecific.length > 0){
+ if (this.state.hour.specificSpecific.length > 0) {
hour = ''
- this.state.hour.specificSpecific.forEach(val=> {
- hour += val+','
+ this.state.hour.specificSpecific.forEach(val => {
+ hour += `${val},`
})
hour = hour.slice(0, -1)
}
@@ -346,12 +348,12 @@ class ReactCron extends React.Component {
minutesText: this.state.minutesText === '*' ? '0' : this.state.minutesText,
minutesValue: this.state.minutesText === '*' ? null : this.state.minutesValue,
hour: data,
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
case '4':
- hour = this.state.hour.rangeStart + '-' + this.state.hour.rangeEnd
+ hour = `${this.state.hour.rangeStart}-${this.state.hour.rangeEnd}`
this.setState({
...this.state,
hourText: hour,
@@ -359,35 +361,35 @@ class ReactCron extends React.Component {
minutesText: this.state.minutesText === '*' ? '0' : this.state.minutesText,
minutesValue: this.state.minutesText === '*' ? null : this.state.minutesValue,
hour: data,
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
- default :
+ default:
break
}
}
- hourMultipleChange = (valArr)=> {
+ hourMultipleChange = (valArr) => {
let hour = '*'
- if(valArr.length > 0){
+ if (valArr.length > 0) {
hour = ''
- valArr.forEach(val=> {
- hour += val+','
+ valArr.forEach(val => {
+ hour += `${val},`
})
hour = hour.slice(0, -1)
}
- let data = Object.assign({}, this.state.hour, { specificSpecific: valArr, hourText: this.state.hour.cronEvery === '3' ? hour : this.state.hourText })
- this.setState({...this.state, hourText: data.hourText, hour: data },() => { this.prettyCronfun() })
+ let data = Object.assign({}, this.state.hour, { specificSpecific: valArr, hourText: this.state.hour.cronEvery === '3' ? hour : this.state.hourText })
+ this.setState({ ...this.state, hourText: data.hourText, hour: data }, () => { this.prettyCronfun() })
}
- /*day*/
+ /* day */
dayOnChange = (val) => {
let weeks = '?'
let day = '*'
- let cronEvery= val.target ? val.target.value : val
- let data = Object.assign({}, this.state.day, {cronEvery: cronEvery.toString()})
- switch (cronEvery.toString()){
+ let cronEvery = val.target ? val.target.value : val
+ let data = Object.assign({}, this.state.day, { cronEvery: cronEvery.toString() })
+ switch (cronEvery.toString()) {
case '1':
this.setState({
...this.state,
@@ -400,7 +402,7 @@ class ReactCron extends React.Component {
dayValue: cronEvery,
monthValue: null,
weekText: '?',
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
@@ -415,7 +417,7 @@ class ReactCron extends React.Component {
hourValue: this.state.hourText === '*' ? null : this.state.hourValue,
weekText: `${this.state.week.incrementIncrement}/${this.state.week.incrementStart}`,
dayValue: cronEvery,
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
@@ -430,15 +432,15 @@ class ReactCron extends React.Component {
hourValue: this.state.hourText === '*' ? null : this.state.hourValue,
dayText: `${this.state.day.incrementIncrement}/${this.state.day.incrementStart}`,
dayValue: cronEvery,
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
case '4':
- if(this.state.week.specificSpecific.length > 0){
+ if (this.state.week.specificSpecific.length > 0) {
weeks = ''
- this.state.week.specificSpecific.forEach(val=> {
- weeks += val+','
+ this.state.week.specificSpecific.forEach(val => {
+ weeks += `${val},`
})
weeks = weeks.slice(0, -1)
}
@@ -452,15 +454,15 @@ class ReactCron extends React.Component {
hourValue: this.state.hourText === '*' ? null : this.state.hourValue,
dayValue: cronEvery,
dayText: '?',
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
case '5':
- if(this.state.day.specificSpecific.length > 0){
+ if (this.state.day.specificSpecific.length > 0) {
day = ''
- this.state.day.specificSpecific.forEach(val=> {
- day += val+','
+ this.state.day.specificSpecific.forEach(val => {
+ day += `${val},`
})
day = day.slice(0, -1)
}
@@ -474,7 +476,7 @@ class ReactCron extends React.Component {
hourValue: this.state.hourText === '*' ? null : this.state.hourValue,
dayValue: cronEvery,
dayText: day,
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
@@ -489,7 +491,7 @@ class ReactCron extends React.Component {
hourValue: this.state.hourText === '*' ? null : this.state.hourValue,
dayValue: cronEvery,
dayText: 'L',
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
@@ -504,7 +506,7 @@ class ReactCron extends React.Component {
hourValue: this.state.hourText === '*' ? null : this.state.hourValue,
dayValue: cronEvery,
dayText: 'LW',
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
@@ -519,7 +521,7 @@ class ReactCron extends React.Component {
hourValue: this.state.hourText === '*' ? null : this.state.hourValue,
dayValue: cronEvery,
dayText: this.state.day.cronLastSpecificDomDay,
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
@@ -534,7 +536,7 @@ class ReactCron extends React.Component {
hourValue: this.state.hourText === '*' ? null : this.state.hourValue,
dayValue: cronEvery,
dayText: `L-${this.state.day.cronDaysBeforeEomMinus}`,
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
@@ -549,7 +551,7 @@ class ReactCron extends React.Component {
hourValue: this.state.hourText === '*' ? null : this.state.hourValue,
dayValue: cronEvery,
dayText: `${this.state.day.cronDaysBeforeEomMinus}W`,
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
@@ -564,64 +566,64 @@ class ReactCron extends React.Component {
hourValue: this.state.hourText === '*' ? null : this.state.hourValue,
weekText: `${this.state.week.cronNthDayDay}#${this.state.week.cronNthDayNth}`,
dayValue: cronEvery,
- },() => {
+ }, () => {
this.prettyCronfun()
})
break
- default :
+ default:
break
}
}
weekChange = (val) => {
let weeks = '?'
- weeks = this.state.week.incrementIncrement+'/'+val
- let data = Object.assign({}, this.state.week, { weekText: this.state.day.cronEvery === '2' ? weeks : this.state.weekText, incrementStart: val })
- this.setState({...this.state, weekText: data.weekText, week: data }, () => { this.prettyCronfun() })
+ weeks = `${this.state.week.incrementIncrement}/${val}`
+ let data = Object.assign({}, this.state.week, { weekText: this.state.day.cronEvery === '2' ? weeks : this.state.weekText, incrementStart: val })
+ this.setState({ ...this.state, weekText: data.weekText, week: data }, () => { this.prettyCronfun() })
}
weekSpeChange = (valArr) => {
let weeks = '?'
- if(valArr.length > 0){
+ if (valArr.length > 0) {
weeks = ''
- valArr.forEach(val=> {
- weeks += val+','
+ valArr.forEach(val => {
+ weeks += `${val},`
})
weeks = weeks.slice(0, -1)
}
- let data = Object.assign({}, this.state.week, { specificSpecific: valArr, weekText: this.state.day.cronEvery === '4' ? weeks : this.state.weekText })
- this.setState({...this.state, weekText: data.weekText, week: data }, () => { this.prettyCronfun() })
+ let data = Object.assign({}, this.state.week, { specificSpecific: valArr, weekText: this.state.day.cronEvery === '4' ? weeks : this.state.weekText })
+ this.setState({ ...this.state, weekText: data.weekText, week: data }, () => { this.prettyCronfun() })
}
daySpeChange = (valArr) => {
let day = '*'
- if(valArr.length > 0){
+ if (valArr.length > 0) {
day = ''
- valArr.forEach(val=> {
- day += val+','
+ valArr.forEach(val => {
+ day += `${val},`
})
day = day.slice(0, -1)
}
- let data = Object.assign({}, this.state.day, { specificSpecific: valArr, dayText: this.state.day.cronEvery === '5' ? day : this.state.dayText })
- this.setState({...this.state, dayText: data.dayText, day: data }, () => { this.prettyCronfun() })
+ let data = Object.assign({}, this.state.day, { specificSpecific: valArr, dayText: this.state.day.cronEvery === '5' ? day : this.state.dayText })
+ this.setState({ ...this.state, dayText: data.dayText, day: data }, () => { this.prettyCronfun() })
}
dayLaChange = (val) => {
- let data = Object.assign({}, this.state.day, { dayText: this.state.day.cronEvery === '8' ? val : this.state.dayText, cronLastSpecificDomDay: val })
- this.setState({...this.state, dayText: data.dayText, day: data }, () => { this.prettyCronfun() })
+ let data = Object.assign({}, this.state.day, { dayText: this.state.day.cronEvery === '8' ? val : this.state.dayText, cronLastSpecificDomDay: val })
+ this.setState({ ...this.state, dayText: data.dayText, day: data }, () => { this.prettyCronfun() })
}
weekLaChange = (val) => {
- let data = Object.assign({}, this.state.week, { weekText: this.state.day.cronEvery === '11' ? `${val}#${this.state.week.cronNthDayNth}` : this.state.weekText, cronNthDayDay: val })
- this.setState({...this.state, weekText: data.weekText, week: data }, () => { this.prettyCronfun() })
+ let data = Object.assign({}, this.state.week, { weekText: this.state.day.cronEvery === '11' ? `${val}#${this.state.week.cronNthDayNth}` : this.state.weekText, cronNthDayDay: val })
+ this.setState({ ...this.state, weekText: data.weekText, week: data }, () => { this.prettyCronfun() })
}
- /*month*/
+ /* month */
monthOnChange = (val) => {
let month = '*'
- let cronEvery= val.target ? val.target.value : val
- let data = Object.assign({}, this.state.month, {cronEvery: cronEvery.toString()})
- switch (cronEvery.toString()){
+ let cronEvery = val.target ? val.target.value : val
+ let data = Object.assign({}, this.state.month, { cronEvery: cronEvery.toString() })
+ switch (cronEvery.toString()) {
case '1':
this.setState({
...this.state,
@@ -639,7 +641,7 @@ class ReactCron extends React.Component {
})
break
case '2':
- month = this.state.month.incrementIncrement + '/' + this.state.month.incrementStart
+ month = `${this.state.month.incrementIncrement}/${this.state.month.incrementStart}`
this.setState({
...this.state,
monthText: month,
@@ -656,10 +658,10 @@ class ReactCron extends React.Component {
})
break
case '3':
- if(this.state.month.specificSpecific.length > 0){
+ if (this.state.month.specificSpecific.length > 0) {
month = ''
- this.state.month.specificSpecific.forEach(val=> {
- month += val+','
+ this.state.month.specificSpecific.forEach(val => {
+ month += `${val},`
})
month = month.slice(0, -1)
}
@@ -679,7 +681,7 @@ class ReactCron extends React.Component {
})
break
case '4':
- month = this.state.month.rangeStart + '-' + this.state.month.rangeEnd
+ month = `${this.state.month.rangeStart}-${this.state.month.rangeEnd}`
this.setState({
...this.state,
monthText: month,
@@ -695,30 +697,30 @@ class ReactCron extends React.Component {
this.prettyCronfun()
})
break
- default :
+ default:
break
}
}
monthMultipleChange = (valArr) => {
let month = '*'
- if(valArr.length > 0){
+ if (valArr.length > 0) {
month = ''
- valArr.forEach(val=> {
- month += val+','
+ valArr.forEach(val => {
+ month += `${val},`
})
month = month.slice(0, -1)
}
- let data = Object.assign({}, this.state.month, { specificSpecific: valArr, monthText: this.state.month.cronEvery === '3' ? month : this.state.monthText })
- this.setState({...this.state, monthText: data.monthText, month: data }, () => { this.prettyCronfun() })
+ let data = Object.assign({}, this.state.month, { specificSpecific: valArr, monthText: this.state.month.cronEvery === '3' ? month : this.state.monthText })
+ this.setState({ ...this.state, monthText: data.monthText, month: data }, () => { this.prettyCronfun() })
}
- /*year*/
+ /* year */
yearOnChange = (val) => {
let year = '*'
- let cronEvery= val.target ? val.target.value : val
- let data = Object.assign({}, this.state.year, {cronEvery: cronEvery.toString()})
- switch (cronEvery.toString()){
+ let cronEvery = val.target ? val.target.value : val
+ let data = Object.assign({}, this.state.year, { cronEvery: cronEvery.toString() })
+ switch (cronEvery.toString()) {
case '1':
this.setState({
...this.state,
@@ -727,7 +729,7 @@ class ReactCron extends React.Component {
})
break
case '2':
- year = this.state.year.incrementStart + '/' + this.state.year.incrementIncrement
+ year = `${this.state.year.incrementStart}/${this.state.year.incrementIncrement}`
this.setState({
...this.state,
yearText: year,
@@ -735,10 +737,10 @@ class ReactCron extends React.Component {
})
break
case '3':
- if(this.state.year.specificSpecific.length > 0){
+ if (this.state.year.specificSpecific.length > 0) {
year = ''
- this.state.year.specificSpecific.forEach(val=> {
- year += val+','
+ this.state.year.specificSpecific.forEach(val => {
+ year += `${val},`
})
year = year.slice(0, -1)
}
@@ -749,40 +751,40 @@ class ReactCron extends React.Component {
})
break
case '4':
- year = this.state.year.rangeStart + '-' + this.state.year.rangeEnd
+ year = `${this.state.year.rangeStart}-${this.state.year.rangeEnd}`
this.setState({
...this.state,
yearText: year,
year: data,
})
break
- default :
+ default:
break
}
}
yearMultipleChange = (valArr) => {
let year = '*'
- if(valArr.length > 0){
+ if (valArr.length > 0) {
year = ''
- valArr.forEach(val=> {
- year += val+','
+ valArr.forEach(val => {
+ year += `${val},`
})
year = year.slice(0, -1)
}
- let data = Object.assign({}, this.state.year, { specificSpecific: valArr, yearText: this.state.year.cronEvery === '3' ? year : this.state.yearText })
- this.setState({...this.state, yearText: data.yearText, year: data })
+ let data = Object.assign({}, this.state.year, { specificSpecific: valArr, yearText: this.state.year.cronEvery === '3' ? year : this.state.yearText })
+ this.setState({ ...this.state, yearText: data.yearText, year: data })
}
CronInputChange = (e) => {
e.persist()
- if(e.target && e.target.value !== 'undefined') {
+ if (e.target && e.target.value !== 'undefined') {
this.setState({
...this.state,
cornText: e.target.value,
prettyCronText: prettyCron.toString(e.target.value),
}, () => {
- if( !cronValidate(e.target.value) ) {
+ if (!cronValidate(e.target.value)) {
this.setState({
...this.state,
cornFormat: true,
@@ -800,17 +802,17 @@ class ReactCron extends React.Component {
}
next() {
- const current = this.state.current + 1;
- this.setState({ current });
+ const current = this.state.current + 1
+ this.setState({ current })
}
prev() {
- const current = this.state.current - 1;
- this.setState({ current });
+ const current = this.state.current - 1
+ this.setState({ current })
}
activeKeyChange(key) {
- this.setState({activeKey: key})
+ this.setState({ activeKey: key })
}
render() {
@@ -823,13 +825,13 @@ class ReactCron extends React.Component {
for (let i = 0; i < 24; i++) {
childrenHour.push()
}
- const weekAry = [{ val: 1, label:'Sunday' }, { val: 2, label:'Monday' }, { val: 3, label:'Tuesday' }, { val: 4, label:'Wednesday' }, { val: 5, label:'Thursday' }, { val: 6, label:'Friday' }, { val: 7, label:'Saturday' }]
+ const weekAry = [{ val: 1, label: 'Sunday' }, { val: 2, label: 'Monday' }, { val: 3, label: 'Tuesday' }, { val: 4, label: 'Wednesday' }, { val: 5, label: 'Thursday' }, { val: 6, label: 'Friday' }, { val: 7, label: 'Saturday' }]
const childrenWeekAry = []
for (let i = 0; i < 7; i++) {
childrenWeekAry.push()
}
- const weekSpeAry = [{ val: 'SUN', label:'Sunday' }, { val: 'MON', label:'Monday' }, { val: 'TUE', label:'Tuesday' }, { val: 'WED', label:'Wednesday' }, { val: 'THU', label:'Thursday' }, { val: 'FRI', label:'Friday' }, { val: 'SAT', label:'Saturday' }]
+ const weekSpeAry = [{ val: 'SUN', label: 'Sunday' }, { val: 'MON', label: 'Monday' }, { val: 'TUE', label: 'Tuesday' }, { val: 'WED', label: 'Wednesday' }, { val: 'THU', label: 'Thursday' }, { val: 'FRI', label: 'Friday' }, { val: 'SAT', label: 'Saturday' }]
const childrenSpeWeekAry = []
for (let i = 0; i < 7; i++) {
childrenSpeWeekAry.push()
@@ -840,7 +842,7 @@ class ReactCron extends React.Component {
childrenSpeMonthAry.push()
}
- const weekLAry = [{ val: '1L', label:'Sunday' }, { val: '2L', label:'Monday' }, { val: '3L', label:'Tuesday' }, { val: '4L', label:'Wednesday' }, { val: '5L', label:'Thursday' }, { val: '6L', label:'Friday' }, { val: '7L', label:'Saturday' }]
+ const weekLAry = [{ val: '1L', label: 'Sunday' }, { val: '2L', label: 'Monday' }, { val: '3L', label: 'Tuesday' }, { val: '4L', label: 'Wednesday' }, { val: '5L', label: 'Thursday' }, { val: '6L', label: 'Friday' }, { val: '7L', label: 'Saturday' }]
const childrenLAWeekAry = []
for (let i = 0; i < 7; i++) {
childrenLAWeekAry.push()
@@ -859,9 +861,9 @@ class ReactCron extends React.Component {
this.activeKeyChange(key)} type="card">
-
-
-
+
@@ -875,9 +877,9 @@ class ReactCron extends React.Component {
))}
-
{
- steps[current].content == 'minutes' ?
-
+
{
+ steps[current].content == 'minutes'
+ ?
@@ -886,16 +888,16 @@ class ReactCron extends React.Component {
Every
- {let data = Object.assign({}, this.state.minutes, { incrementStart: val, minutesText: this.state.minutes.cronEvery === '2' ? `${this.state.minutes.incrementIncrement}/${val}` : this.state.minutesText }); this.setState({...this.state, minutesText: data.minutesText, minutes: data },() => { this.prettyCronfun() })}} >
+ { let data = Object.assign({}, this.state.minutes, { incrementStart: val, minutesText: this.state.minutes.cronEvery === '2' ? `${this.state.minutes.incrementIncrement}/${val}` : this.state.minutesText }); this.setState({ ...this.state, minutesText: data.minutesText, minutes: data }, () => { this.prettyCronfun() }) }}>
minutes(s) starting at minutes
- {let data = Object.assign({}, this.state.minutes, { incrementIncrement: val, minutesText: this.state.minutes.cronEvery === '2' ? `${val}/${this.state.minutes.incrementStart}` : this.state.minutesText }); this.setState({...this.state, minutesText: data.minutesText, minutes: data },() => { this.prettyCronfun() })}} >
+ { let data = Object.assign({}, this.state.minutes, { incrementIncrement: val, minutesText: this.state.minutes.cronEvery === '2' ? `${val}/${this.state.minutes.incrementStart}` : this.state.minutesText }); this.setState({ ...this.state, minutesText: data.minutesText, minutes: data }, () => { this.prettyCronfun() }) }}>
Specific minutes (choose one or many)
-
+
: ''}
- {steps[current].content == 'hour' ?
-
+ {steps[current].content == 'hour'
+ ?
@@ -928,16 +930,16 @@ class ReactCron extends React.Component {
Every
- {let data = Object.assign({}, this.state.hour, { incrementStart: val, hourText: this.state.hour.cronEvery === '2' ? `${this.state.hour.incrementIncrement}/${val}` : this.state.hourText }); this.setState({...this.state, hourText: data.hourText, hour: data },() => { this.prettyCronfun() })}} >
+ { let data = Object.assign({}, this.state.hour, { incrementStart: val, hourText: this.state.hour.cronEvery === '2' ? `${this.state.hour.incrementIncrement}/${val}` : this.state.hourText }); this.setState({ ...this.state, hourText: data.hourText, hour: data }, () => { this.prettyCronfun() }) }}>
hour(s) starting at hour
- {let data = Object.assign({}, this.state.hour, { incrementIncrement: val, hourText: this.state.hour.cronEvery === '2' ? `${val}/${this.state.hour.incrementStart}` : this.state.hourText }); this.setState({...this.state, hourText: data.hourText, hour: data },() => { this.prettyCronfun() })}} >
+ { let data = Object.assign({}, this.state.hour, { incrementIncrement: val, hourText: this.state.hour.cronEvery === '2' ? `${val}/${this.state.hour.incrementStart}` : this.state.hourText }); this.setState({ ...this.state, hourText: data.hourText, hour: data }, () => { this.prettyCronfun() }) }}>
Specific hour (choose one or many)
-
+
: ''}
- {steps[current].content == 'day' ?
-
+ {steps[current].content == 'day'
+ ?
@@ -970,7 +972,7 @@ class ReactCron extends React.Component {
Every
- {let data = Object.assign({}, this.state.week, { incrementIncrement: val, weekText: this.state.day.cronEvery === '2' ? `${val}/${this.state.week.incrementStart}` : this.state.weekText }); this.setState({...this.state, weekText: data.weekText, week: data }, () => { this.prettyCronfun() })}}>
+ { let data = Object.assign({}, this.state.week, { incrementIncrement: val, weekText: this.state.day.cronEvery === '2' ? `${val}/${this.state.week.incrementStart}` : this.state.weekText }); this.setState({ ...this.state, weekText: data.weekText, week: data }, () => { this.prettyCronfun() }) }}>
day(s) starting on