From 40761e2aeb30c170259e6aff1f6a5f4825269116 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 12 May 2017 16:33:33 +0800 Subject: [PATCH] getMonthDay --- bi/core.js | 5 +++-- docs/core.js | 5 +++-- src/core/proto/date.js | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bi/core.js b/bi/core.js index 494b9d052..6b0896e75 100644 --- a/bi/core.js +++ b/bi/core.js @@ -6579,8 +6579,9 @@ Date.checkLegal = function (str) { if (ar.length <= 2) { return MM >= 1 && MM <= 12; } - Date._MD[1] = Date.isLeap(YY) ? 29 : 28; - return MM >= 1 && MM <= 12 && DD <= Date._MD[MM - 1]; + var MD = Date._MD.slice(0); + MD[1] = Date.isLeap(YY) ? 29 : 28; + return MM >= 1 && MM <= 12 && DD <= MD[MM - 1]; }; Date.parseDateTime = function (str, fmt) { diff --git a/docs/core.js b/docs/core.js index 0bd912d24..0b43853e7 100644 --- a/docs/core.js +++ b/docs/core.js @@ -24062,8 +24062,9 @@ Date.checkLegal = function (str) { if (ar.length <= 2) { return MM >= 1 && MM <= 12; } - Date._MD[1] = Date.isLeap(YY) ? 29 : 28; - return MM >= 1 && MM <= 12 && DD <= Date._MD[MM - 1]; + var MD = Date._MD.slice(0); + MD[1] = Date.isLeap(YY) ? 29 : 28; + return MM >= 1 && MM <= 12 && DD <= MD[MM - 1]; }; Date.parseDateTime = function (str, fmt) { diff --git a/src/core/proto/date.js b/src/core/proto/date.js index 36197df93..75e833c6a 100644 --- a/src/core/proto/date.js +++ b/src/core/proto/date.js @@ -386,8 +386,9 @@ Date.checkLegal = function (str) { if (ar.length <= 2) { return MM >= 1 && MM <= 12; } - Date._MD[1] = Date.isLeap(YY) ? 29 : 28; - return MM >= 1 && MM <= 12 && DD <= Date._MD[MM - 1]; + var MD = Date._MD.slice(0); + MD[1] = Date.isLeap(YY) ? 29 : 28; + return MM >= 1 && MM <= 12 && DD <= MD[MM - 1]; }; Date.parseDateTime = function (str, fmt) {