diff --git a/docs/laydate/detail/options.md b/docs/laydate/detail/options.md index 612f44d3..b11fed89 100644 --- a/docs/laydate/detail/options.md +++ b/docs/laydate/detail/options.md @@ -638,9 +638,9 @@ mark: { ``` mark: function (ymd, render) { - var y = ymd[0]; - var m = ymd[1]; - var d = ymd[2]; + var y = ymd.year; + var m = ymd.month; + var d = ymd.date; // 字符串 if (m === 6 && d === 1) return render('儿童节'); @@ -689,9 +689,9 @@ holidays: [ ``` holidays: function (ymd, render) { - var y = ymd[0]; - var m = ymd[1]; - var d = ymd[2]; + var y = ymd.year; + var m = ymd.month; + var d = ymd.date; // 字符串 if (y === 2023 && m === 6) { diff --git a/src/modules/laydate.js b/src/modules/laydate.js index fe0d3c26..702863b1 100644 --- a/src/modules/laydate.js +++ b/src/modules/laydate.js @@ -1106,7 +1106,7 @@ } if(typeof options.mark === 'function'){ - options.mark(YMD, render); + options.mark({year: YMD[0], month: YMD[1], date: YMD[2]}, render); }else if(typeof options.mark === 'object'){ render(options.mark); } @@ -1178,7 +1178,7 @@ } if(typeof options.holidays === 'function'){ - options.holidays(YMD, render); + options.holidays({year: YMD[0], month: YMD[1], date: YMD[2]}, render); }else if(layui.type(options.holidays) === 'array'){ render(options.holidays); }