sojinantony01 / react-cron-generator

Simple react component to generate cron expressions
MIT License
86 stars 63 forks source link

When setting the cron expression '* * * * * * *' as the initial value and opening the generator, it is not recognized. #55

Closed developergunny closed 1 year ago

developergunny commented 1 year ago

Intended behavior: When ' ' is entered, the custom header should be selected, and ' ' should be filled in.

However, an error message saying "An error occured when generating the expression description. Check the cron expression syntax." appears.

or

When the time tab is selected, it automatically converts to '0 0 00 1/1 ? '.

  const [result, setResult] = useState('* * * * * * *');

  <Cron
      onChange={(e) => {
          setResult(e);
      }}
      value={result}
      showResultText
      showResultCron={false}
  />
developergunny commented 1 year ago

I've identified that the issue occurred due to my mistake of executing onChange once during rendering.

I apologize for raising the issue without checking thoroughly.

Closing the issue.

sojinantony01 commented 1 year ago

@developergunny Thanks for using the package. please revert back if any support required.