From 6b9ffe7644030487f4d072c0101f8fabdfdaa31a Mon Sep 17 00:00:00 2001 From: Nicolas Riesco Date: Wed, 14 Dec 2016 11:36:29 +0000 Subject: [PATCH] chinese: toChineseMonth to accept dates --- jquery-src/jquery.calendars.chinese.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jquery-src/jquery.calendars.chinese.js b/jquery-src/jquery.calendars.chinese.js index 9ef1443..71149df 100755 --- a/jquery-src/jquery.calendars.chinese.js +++ b/jquery-src/jquery.calendars.chinese.js @@ -208,11 +208,16 @@ /** Retrieve the month (i.e. accounting for intercalary months). @memberof ChineseCalendar - @param year {number} The year. + @param year {CDate|number} The date or the year to examine. @param monthIndex {number} The month index (0 for first month). @return {number} The month (1 for first month). @throws Error if an invalid month/year or a different calendar used. */ toChineseMonth: function(year, monthIndex) { + if (year.year) { + year = year.year(); + monthIndex = year.month(); + } + // compute intercalary month in the year (0 if none) var intercalaryMonth = this.intercalaryMonth(year);