import React, { useEffect } from 'react'; import PropTypes from 'prop-types'; import { TextInput, FormGroup, ValidatedOptions } from '@patternfly/react-core'; import { translate as __ } from 'foremanReact/common/I18n'; import { helpLabel } from '../form/FormHelpers'; export const RepeatCron = ({ repeatData, setRepeatData, setValid }) => { const { cronline } = repeatData; useEffect(() => { if (cronline) { setValid(true); } else { setValid(false); } return () => setValid(true); }, [setValid, cronline]); return ( {__("Cron line format 'a b c d e', where:")}
  1. {__('is minute (range: 0-59)')}
  2. {__('is hour (range: 0-23)')}
  3. {__('is day of month (range: 1-31)')}
  4. {__('is month (range: 1-12)')}
  5. {__('is day of week (range: 0-6)')}
)} isRequired > { setRepeatData({ cronline: newTime }); }} />
); }; RepeatCron.propTypes = { repeatData: PropTypes.object.isRequired, setRepeatData: PropTypes.func.isRequired, setValid: PropTypes.func.isRequired, };