From f11bda4bb30f3509e25a5c359980eb7c8f8dc904 Mon Sep 17 00:00:00 2001 From: Yushi Sun Date: Thu, 1 Sep 2016 14:08:31 +0800 Subject: [PATCH] fix wrong day of week range --- README.md | 2 +- cron.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 877cbac..d866a54 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Available Cron patterns: Another example: - new CronJob('00 30 11 * * 2-6', function(){ + new CronJob('00 30 11 * * 1-5', function(){ // Runs every weekday (Monday through Friday) // at 11:30:00 AM. It does not run on Saturday // or Sunday. diff --git a/cron.js b/cron.js index c73622f..b7b0b21 100644 --- a/cron.js +++ b/cron.js @@ -21,7 +21,7 @@ var CronJob = (function(){ this.source = time; this.map = ['second', 'minute', 'hour', 'dayOfMonth', 'month', 'dayOfWeek']; - this.constraints = [[0,59],[0,59],[0,23],[1,31],[0,11],[1,7]]; + this.constraints = [[0,59],[0,59],[0,23],[1,31],[0,11],[0,6]]; this.aliases = { jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12, sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6 @@ -171,4 +171,4 @@ var CronJob = (function(){ return CronJob; -})(); \ No newline at end of file +})(); \ No newline at end of file