ghostunicorns/module-cron-string-validator

This Magento 2 Module add a new cron backend validator

Installs: 1 817

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

Type:magento2-module

1.0.0 2021-06-30 11:09 UTC

This package is auto-updated.

Last update: 2024-04-29 04:59:16 UTC


README

This module allows you to add a cron string validator to admin config fields

Install

composer require ghostunicorns/module-cron-string-validator

Use

Use it when you create a custom field that will contain a cron expression:

<field id="cron_expression" translate="Cronexpression"
                   type="text" sortOrder="100" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Cron Tab String</label>
                <comment><![CDATA[
<pre>
* * * * *
| | | | |
| | | | +---- Day of the Week   (range: 0-6, 1 standing for Monday)
| | | +------ Month of the Year (range: 1-12)
| | +-------- Day of the Month  (range: 1-31)
| +---------- Hour              (range: 0-23)
+------------ Minute            (range: 0-59)
Example: 0 0 * * * Daily at midnight
</pre>
                ]]></comment>
                <validate>required-entry cronexpression</validate>
            </field>