How to use the cron.CronTest function in cron

To help you get started, weโ€™ve selected a few cron examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github domogik / domogik / src / domogik / admin / static / js / blockly_cron_edit.js View on Github external
["Dusk","@dusk"]
];

var PREDEFINED_OPTIONS = [
    ["Yearly","@yearly"],
    ["Anually","@anually"],
    ["Monthly","@monthly"],
    ["Weekly","@weekly"],
    ["Daily","@daily"],
    ["Midnight","@midnight"],
    ["Hourly","@hourly"]
];
var WEEKDAYS = [["Sunday", "0"], ["Monday", "1"], ["Tuesday", "2"], ["Wednesday", "3"], ["Thursday", "4"], ["Friday", "5"], ["Saturday", "6"]];
var MONTHS = [["January", "1"], ["Frebruary", "2"], ["March", "3"], ["April", "4"], ["May", "5"], ["June", "6"], ["July", "7"], ["August", "8"], ["September", "9"], ["October", "10"], ["November", "11"], ["December", "12"]];

Blockly.Blocks['cron.CronTest'] = {
  init: function() {
    var dropdown = new Blockly.FieldDropdown([["Text", "txt"], ["Blockly", "blockly"],["Ephemeris", "ephem"],["Predefined", "predef"]], function(option) {
        this.sourceBlock_.updateShape_(option);
    });
    this.appendDummyInput()
        .appendField("Trigger on crontab rule ")
        .appendField(dropdown, "crontype")
        .appendField(new Blockly.FieldClickImage('/static/images/icon-cron-invalid.png', 20, 20, '*', createCronCheckDialog),"btCheck");
    this.appendDummyInput("CronExp")
        .appendField("Cron expression :")
        .appendField(new Blockly.FieldTextInput(""), "cron.cron");
    this.setOutput(true);
    this.setColour(120);
    this.setTooltip('');
    this.initDialCheck = false;
    this.cronStatus = {'value': "", 'oldVal': "", 'valid': true};

cron

Cron jobs for your node

MIT
Latest version published 6 days ago

Package Health Score

95 / 100
Full package analysis