How to use the RecurrenceRule function from node-schedule

Find comprehensive JavaScript node-schedule.RecurrenceRule code examples handpicked from public code repositorys.

4
5
6
7
8
9
10
11
12
13
14
const schedule = require("node-schedule");
let router = require("express").Router();
router.use(require("express").json());
globalThis.coronaSanitizer = require("sanitize-html");


const rule = new schedule.RecurrenceRule();
rule.dayOfWeek = 0;
rule.hour = 12;
rule.minute = 0;
schedule.scheduleJob(rule, async function () {
fork icon52
star icon181
watch icon4

+ 9 other calls in file

14
15
16
17
18
19
20
21
22
23
24
25
export class Server {


    constructor(port) {
        PORT = port


        let rule = new schedule.RecurrenceRule()
        rule.hour = 0
        rule.minute = 0
        rule.second = 0
        job = schedule.scheduleJob(rule, () => {
fork icon0
star icon0
watch icon1

745
746
747
748
749
750
751
752
753
754
    let errorMsg = "Scheduler: " + questionInfo.qId + " - On days in incorrect format or not specified"
    return ReturnMethods.returnFailure(errorMsg)
}

// Build recurrence rule and return
let rule = new scheduler.RecurrenceRule();
rule.dayOfWeek = scheduleDayIndices;
rule.hour = scheduleHours;
rule.minute = scheduleMins;
if(questionInfo.tz) rule.tz = questionInfo.tz;
fork icon0
star icon0
watch icon1