From 0df87d3c1e086106cc36f0cd0357812ea779aff2 Mon Sep 17 00:00:00 2001 From: TsaiKoga <969024089@qq.com> Date: Wed, 18 Sep 2019 18:17:54 +0800 Subject: [PATCH] [Fix] Fix alias name of month & week-of-day --- package.json | 2 +- src/renderer/store/modules/Cron.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a5b73a..1e45852 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "IT-Tools", "productName": "IT Tools", - "version": "1.5.0", + "version": "1.5.1", "author": "TsaiKoga ", "description": "Help programers quickly solve problem.To be a life saver.", "license": "Apache-2.0", diff --git a/src/renderer/store/modules/Cron.js b/src/renderer/store/modules/Cron.js index 59260d7..28bf3bd 100644 --- a/src/renderer/store/modules/Cron.js +++ b/src/renderer/store/modules/Cron.js @@ -213,6 +213,11 @@ const helpers = { i18n.t('cronHelp.friday'), i18n.t('cronHelp.saturday') ] + let aliases = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] + let numStr = String(num).toLowerCase() + if (aliases.includes(numStr)) { + num = aliases.findIndex(x => x === numStr) + } return dayOfWeek[num] }, @@ -235,6 +240,13 @@ const helpers = { 11: 'November', 12: 'December' } + + let aliases = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'] + let numStr = String(num).toLowerCase() + if (aliases.includes(numStr)) { + num = aliases.findIndex(x => x === numStr) + 1 + } + return (i18n.locale === 'en') ? dayOfMonth[num] : (num + i18n.t('cronHelp.month')) },