calendar.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. /**
  2. * 日历库
  3. * 作者:tmzdy
  4. * 时间:2021-7-27
  5. * 联系:zhongjihan@sina.com
  6. */
  7. class calendar{
  8. value= new Date();
  9. now_day_month = new Date();
  10. start_time = new Date(1900,0,1)
  11. end_time = new Date(2100,11,31)
  12. txtdateArray = [];
  13. /**
  14. * value:初始化时间
  15. * start:开始始间 ,提供了后,会在返回的日历上标记每个日期是否是在start 和 end之间。
  16. * end:结束时间
  17. */
  18. constructor({value,start,end}) {
  19. if(arguments.length===1){
  20. let arg = arguments[0]
  21. if(arg?.value){
  22. value = value.replace(/-/g,'/');
  23. let dobj = new Date(value);
  24. this.value = new Date(dobj.getFullYear(),dobj.getMonth(),dobj.getDate());
  25. this.now_day_month = this.value;
  26. }
  27. if(arg?.start){
  28. let sv = start;
  29. if(typeof sv ==='string'){
  30. sv = new Date(sv.replace(/-/g,'/'))
  31. }else if(typeof sv === 'object'){
  32. sv = new Date(sv)
  33. }
  34. this.start_time = sv;
  35. }
  36. if(arg?.end){
  37. let sv = end;
  38. if(typeof sv ==='string'){
  39. sv = new Date(sv.replace(/-/g,'/'))
  40. }else if(typeof sv === 'object'){
  41. sv = new Date(sv)
  42. }
  43. this.end_time = sv;
  44. }
  45. }
  46. }
  47. /**
  48. * 日期转化为字符串, 4位年+2位月+2位日
  49. */
  50. getDateStr(date) {
  51. var _year = date.getFullYear();
  52. var _month = date.getMonth(); // 月从0开始计数
  53. var _d = date.getDate();
  54. _month = (_month > 9) ? ("" + _month) : ("0" + _month);
  55. _d = (_d > 9) ? ("" + _d) : ("0" + _d);
  56. return _year + _month + _d;
  57. }
  58. // 设置当前计算的日历的时间 。格式为时间 格式。
  59. setValue(value){
  60. if(value){
  61. let dobj = new Date();
  62. if(typeof value === 'object'){
  63. dobj = new Date(value);
  64. }else{
  65. value = value.replace(/-/g,'/');
  66. dobj = new Date(value);
  67. }
  68. this.value = new Date(dobj.getFullYear(),dobj.getMonth(),dobj.getDate());
  69. this.now_day_month = this.value;
  70. }
  71. return this;
  72. }
  73. // 未设置
  74. setStart(start){
  75. let sv = start;
  76. if(typeof sv ==='string'){
  77. sv = new Date(sv.replace(/-/g,'/'))
  78. }else if(typeof sv === 'object'){
  79. sv = new Date(sv)
  80. }
  81. this.start_time = sv;
  82. return this;
  83. }
  84. setEnd(end){
  85. let sv = end;
  86. if(typeof sv ==='string'){
  87. sv = new Date(sv.replace(/-/g,'/'))
  88. }else if(typeof sv === 'object'){
  89. sv = new Date(sv)
  90. }
  91. this.end_time = sv;
  92. return this;
  93. }
  94. // 设置文本数据。携带在对象 中。
  95. setTimeArrayText(textArray){
  96. if(!Array.isArray(textArray)) return;
  97. /**
  98. * textArray
  99. * {date:"2021-7-1",text:"你好"}
  100. */
  101. this.txtdateArray = textArray;
  102. return this;
  103. }
  104. monthDay(year, month) {
  105. var date = new Date(year, month, 1, 0, 0, 0)
  106. var yesterDay = new Date(date - 1000)
  107. return yesterDay.getDate()
  108. }
  109. nongli(year,month,day){
  110. const calendarobj = {
  111. gregorianYear: null, //公历年
  112. gregorianMonth: null, //公历月
  113. gregorianDay: null, //公历日
  114. weekday: null, //星期
  115. hours: null,
  116. minutes: null,
  117. seconds: null,
  118. lunarYear: null, //农历年
  119. lunarMonth: null, //农历月
  120. lunarDay: null, //农历日
  121. lunarYearCn: '', //农历天干地支纪年
  122. lunarMonthCn: '', //农历中文月
  123. lunarDayCn: '', //农历中文日
  124. zodiacYear: '', //农历生肖年
  125. solarTerm: '', //节气
  126. gregorianFestival: '', //公历节日
  127. lunarFestival: '' //农历节日
  128. }
  129. let lunarInfo = [
  130. 0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2,
  131. 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977,
  132. 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970,
  133. 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950,
  134. 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557,
  135. 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5d0, 0x14573, 0x052d0, 0x0a9a8, 0x0e950, 0x06aa0,
  136. 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0,
  137. 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b5a0, 0x195a6,
  138. 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570,
  139. 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0,
  140. 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5,
  141. 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930,
  142. 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530,
  143. 0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45,
  144. 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0]
  145. let zodiacs = ['鼠', '牛', '虎', '兔', '龙', '蛇', '马', '羊', '猴', '鸡', '狗', '猪']
  146. let Gan = ['甲', '乙', '丙', '丁', '戊', '己', '庚', '辛', '壬', '癸']
  147. let Zhi = ['子', '丑', '寅', '卯', '辰', '巳', '午', '未', '申', '酉', '戌', '亥']
  148. let weekday = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']
  149. let now = new Date()
  150. //用于计算农历年月日的数据
  151. let GY = year
  152. let GM = month
  153. let GD = day
  154. //==== 传入 offset 传回干支, 0=甲子
  155. function cyclical(num) {
  156. return(Gan[num % 10] + Zhi[num % 12])
  157. }
  158. //==== 传回农历 year年的总天数
  159. function lYearDays(year) {
  160. let i, sum = 348
  161. for(i = 0x8000; i > 0x8; i >>= 1) {
  162. sum += (lunarInfo[year - 1900] & i) ? 1: 0
  163. }
  164. return(sum + leapDays(year))
  165. }
  166. //==== 传回农历 year年闰月的天数
  167. function leapDays(year) {
  168. if(leapMonth(year)) {
  169. return((lunarInfo[year-1900] & 0x10000)? 30: 29)
  170. }
  171. else {
  172. return 0
  173. }
  174. }
  175. //==== 传回农历 year年闰哪个月 1-12 , 没闰传回 0
  176. function leapMonth(year) {
  177. return(lunarInfo[year - 1900] & 0xf)
  178. }
  179. //==== 传回农历 year年month月的总天数
  180. function monthDays(year, month) {
  181. return( (lunarInfo[year - 1900] & (0x10000 >> month))? 30: 29 )
  182. }
  183. //==== 算出农历, 传入日期对象, 传回农历日期对象
  184. // 该对象属性有 农历年year 农历月month 农历日day 是否闰年isLeap yearCyl dayCyl monCyl
  185. function Lunar(objDate) {
  186. let i, temp = 0
  187. let baseDate = new Date(1900,0,31)
  188. let offset = Math.floor((objDate - baseDate)/86400000)
  189. let dayCyl = offset + 40
  190. let monCyl = 14
  191. for(i = 1900; i < 2050 && offset > 0; i++) {
  192. temp = lYearDays(i)
  193. offset -= temp
  194. monCyl += 12
  195. }
  196. if(offset < 0) {
  197. offset += temp;
  198. i--;
  199. monCyl -= 12
  200. }
  201. //农历年
  202. let year = i
  203. let yearCyl = i-1864
  204. let leap = leapMonth(i) //闰哪个月
  205. let isLeap = false //是否闰年
  206. for(i=1; i<13 && offset>0; i++) {
  207. //闰月
  208. if(leap>0 && i === (leap+1) && isLeap === false) {
  209. --i; isLeap = true; temp = leapDays(year);
  210. }
  211. else {
  212. temp = monthDays(year, i);
  213. }
  214. //解除闰月
  215. if(isLeap === true && i === (leap + 1)) {
  216. isLeap = false
  217. }
  218. offset -= temp
  219. if(isLeap === false) {
  220. monCyl ++
  221. }
  222. }
  223. if(offset === 0 && leap>0 && i===leap+1)
  224. if(isLeap) {
  225. isLeap = false
  226. }
  227. else {
  228. isLeap = true
  229. --i
  230. --monCyl
  231. }
  232. if(offset<0){
  233. offset += temp
  234. --i
  235. --monCyl
  236. }
  237. //农历月
  238. let month = i
  239. //农历日
  240. let day = offset + 1
  241. return {
  242. year: year,
  243. month: month,
  244. day: day,
  245. isLeap: isLeap,
  246. leap: leap,
  247. yearCyl: yearCyl,
  248. dayCyl: dayCyl,
  249. monCyl: monCyl
  250. }
  251. }
  252. //==== 中文日期 m为传入月份,d为传入日期
  253. function cDay(m, d){
  254. let nStr1 = ['日', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
  255. let nStr2 = ['初', '十', '廿', '卅', '']
  256. //农历中文月
  257. let lunarMonthCn
  258. //农历中文日
  259. let lunarDayCn
  260. if (m > 10){
  261. lunarMonthCn = '十' + nStr1[m - 10]
  262. } else {
  263. lunarMonthCn = nStr1[m]
  264. }
  265. lunarMonthCn += '月'
  266. switch (d) {
  267. case 10: lunarDayCn = '初十'; break;
  268. case 20: lunarDayCn = '二十'; break;
  269. case 30: lunarDayCn = '三十'; break;
  270. default: lunarDayCn = nStr2[Math.floor(d/10)] + nStr1[d % 10]
  271. }
  272. return {
  273. lunarMonthCn: lunarMonthCn,
  274. lunarDayCn: lunarDayCn
  275. }
  276. }
  277. //节气
  278. function getSolarTerm() {
  279. let sTermInfo = [
  280. 0, 21208, 42467, 63836, 85337, 107014,
  281. 128867, 150921, 173149, 195551, 218072, 240693,
  282. 263343, 285989, 308563, 331033, 353350, 375494,
  283. 397447, 419210, 440795, 462224, 483532, 504758
  284. ]
  285. let solarTerm = [
  286. '小寒', '大寒', '立春', '雨水', '惊蛰', '春分',
  287. '清明', '谷雨', '立夏', '小满', '芒种', '夏至',
  288. '小暑', '大暑', '立秋', '处暑', '白露', '秋分',
  289. '寒露', '霜降', '立冬', '小雪', '大雪', '冬至'
  290. ]
  291. let solarTerms = ''
  292. let tmp1 = new Date(
  293. (31556925974.7 * (GY - 1900) + sTermInfo[(GM-1) * 2 + 1] * 60000) + Date.UTC(1900,0,6,2,5)
  294. )
  295. let tmp2 = tmp1.getUTCDate()
  296. if (tmp2 === GD) solarTerms = solarTerm[(GM-1) * 2 + 1]
  297. tmp1 = new Date(
  298. (31556925974.7 * (GY - 1900) + sTermInfo[(GM-1) * 2] * 60000) + Date.UTC(1900,0,6,2,5)
  299. )
  300. tmp2= tmp1.getUTCDate()
  301. if (tmp2 === GD) solarTerms = solarTerm[(GM-1) * 2]
  302. return solarTerms
  303. }
  304. //==== 中文日期 m为传入月份,d为传入日期
  305. function cDay(m ,d ){
  306. let nStr1 = ['日', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
  307. let nStr2 = ['初', '十', '廿', '卅', '']
  308. //农历中文月
  309. let lunarMonthCn
  310. //农历中文日
  311. let lunarDayCn
  312. if (m > 10){
  313. lunarMonthCn = '十' + nStr1[m - 10]
  314. } else {
  315. lunarMonthCn = nStr1[m]
  316. }
  317. lunarMonthCn += '月'
  318. switch (d) {
  319. case 10: lunarDayCn = '初十'; break;
  320. case 20: lunarDayCn = '二十'; break;
  321. case 30: lunarDayCn = '三十'; break;
  322. default: lunarDayCn = nStr2[Math.floor(d/10)] + nStr1[d % 10]
  323. }
  324. return {
  325. lunarMonthCn: lunarMonthCn,
  326. lunarDayCn: lunarDayCn
  327. }
  328. }
  329. //去掉时分秒的日期
  330. let sDObj = new Date(GY, GM-1, GD);
  331. let lDObj = new Lunar(sDObj);
  332. //节气
  333. // calendar.solarTerm = getSolarTerm()
  334. let n = cDay(lDObj.month,lDObj.day);
  335. let y = cyclical( GY - 1900 + 36);
  336. return {
  337. year:y,
  338. month:n.lunarMonthCn,
  339. day:n.lunarDayCn,
  340. shengxiao:zodiacs[(GY - 4) % 12],
  341. jieqi:getSolarTerm()
  342. };
  343. }
  344. //下个月,可以一直操作
  345. nextMonth(){
  346. this.value = new Date(this.value.getFullYear(),this.value.getMonth()+1,1);
  347. return this;
  348. }
  349. //上个月,可以一直操作
  350. prevMonth(){
  351. this.value = new Date(this.value.getFullYear(),this.value.getMonth()-1,1);
  352. return this;
  353. }
  354. //下一年
  355. nexYear(){
  356. this.value = new Date(this.value.getFullYear()+1,this.value.getMonth(),this.value.getDate());
  357. return this;
  358. }
  359. //上一年
  360. prevYear(){
  361. this.value = new Date(this.value.getFullYear()-1,this.value.getMonth(),this.value.getDate());
  362. return this;
  363. }
  364. // 把之前设置的上一年,下一年,上一月下一月等数据清除,恢复 到最原始的月份年份数据。
  365. setInit(){
  366. this.value = this.now_day_month;
  367. return this;
  368. }
  369. // 返回初始化时的月份
  370. getNowData(){
  371. // 当前时间 。
  372. let week = [7,1,2,3,4,5,6]
  373. let text_week = ['周日','周一','周二','周三','周四','周五','周六']
  374. let _thisdateStr = this.now_day_month.toLocaleString();
  375. let _thisMothn = this.now_day_month.getMonth();//当前月
  376. let _thisDay = this.now_day_month.getDate();//当前日
  377. let _thisYear = this.now_day_month.getFullYear();//当前年
  378. let _thisWeek = this.now_day_month.getDay();//当前周
  379. let _thisMothn_day = new Date(_thisYear,_thisMothn,1) ; ///当月第一天数据。
  380. let _thisDayDate = new Date(_thisYear,_thisMothn,_thisDay);
  381. let months = [31,this.monthDay(_thisYear,_thisMothn),31,30,31,30,31,31,30,31,30,31];
  382. let _thisMothn_lastDay = new Date(_thisYear,_thisMothn,months[_thisMothn]) ; ///当月最后数据。
  383. let dateArray = [];//当前日历表数据。
  384. let llineDate = [];//行数据。
  385. let j=1;
  386. let ishs = true //如果第一排没有本月数据需要切换模式。把本月放第一位。
  387. for(let i=1 ;i <8;i++){
  388. let tdy = new Date(_thisYear, _thisMothn, i - 6 - _thisMothn_day.getDay()); //当前循环日期。
  389. if(i==7){
  390. let tf = tdy.getTime()>= _thisMothn_day.getTime() && tdy.getTime() <= _thisMothn_lastDay.getTime() ?true:false;
  391. if(!tf){
  392. ishs = false;
  393. break;
  394. }
  395. }
  396. }
  397. for(let i=1 ;i <43;i++){
  398. var Day = null;
  399. if(!ishs){
  400. Day = new Date(_thisYear, _thisMothn, i + 1 - _thisMothn_day.getDay()); //当前循环日期。
  401. }else{
  402. Day = new Date(_thisYear, _thisMothn, i - 6 - _thisMothn_day.getDay()); //当前循环日期。
  403. }
  404. dateArray.push({
  405. year:Day.getFullYear(),//年
  406. month:Day.getMonth()+1,//月1-12
  407. week:week[Day.getDay()],//周的数字1~7
  408. week_text:text_week[Day.getDay()],//周的中文
  409. day:Day.getDate(),//几号
  410. prevMoth: Day.getTime() < _thisMothn_day.getTime() ?true:false,//是否是上月。
  411. nowMonth: Day.getTime()>= _thisMothn_day.getTime() && Day.getTime() <= _thisMothn_lastDay.getTime() ?true:false,//是否当月
  412. nowDay:Day.getTime() == _thisDayDate.getTime() ?true:false,//是否是当天。
  413. nowYear:0,//是否当年
  414. nextMoth: Day.getTime() > _thisMothn_lastDay.getTime()?true:false,//是否下月
  415. beginEnd: Day.getTime() >= this.start_time.getTime() && Day.getTime() <= this.end_time.getTime()?true:false,//是否在开始和结束区间范围内。
  416. nongli:this.nongli(Day.getFullYear(),Day.getMonth()+1,Day.getDate())
  417. })
  418. }
  419. return dateArray;
  420. }
  421. // 返回当前选中月的日历数组。如果你不设置value和数据getNowData和getData相等。
  422. /**
  423. * 返回当前月数据。
  424. * @return {
  425. beginEnd: false,//是否在规定范围时间内
  426. day: 16,//日
  427. month: 7,//月
  428. nextMoth: false,//是否下月
  429. nowDay: false,//是否当天
  430. nowMonth: true,//是否当月
  431. prevMoth: false,/是否下月
  432. week: 5,//周1-7
  433. week_text: "周五",//同上
  434. year: 2021,//年
  435. nongli:{ //农历
  436. day: "初七",//日
  437. jieqi: "",//节气
  438. month: "六月",//月
  439. shengxiao: "牛",//生肖
  440. year: "辛丑" //农历年
  441. }
  442. }
  443. */
  444. getData(){
  445. // 当前时间 。
  446. let week = [7,1,2,3,4,5,6]
  447. let text_week = ['周日','周一','周二','周三','周四','周五','周六']
  448. let _thisdateStr = this.value.toLocaleString();
  449. let _thisMothn = this.value.getMonth();//当前月
  450. let _thisDay = this.value.getDate();//当前日
  451. let _thisYear = this.value.getFullYear();//当前年
  452. let _thisWeek = this.value.getDay();//当前周
  453. let _thisMothn_day = new Date(_thisYear,_thisMothn,1) ; ///当月第一天数据。
  454. let _thisDayDate = new Date(_thisYear,_thisMothn,_thisDay);
  455. let months = [31,this.monthDay(_thisYear,_thisMothn),31,30,31,30,31,31,30,31,30,31];
  456. let _thisMothn_lastDay = new Date(_thisYear,_thisMothn,months[_thisMothn]) ; ///当月最后数据。
  457. let dateArray = [];//当前日历表数据。
  458. let llineDate = [];//行数据。
  459. let j=1;
  460. let ishs = true //如果第一排没有本月数据需要切换模式。把本月放第一位。
  461. for(let i=1 ;i <8;i++){
  462. let tdy = new Date(_thisYear, _thisMothn, i - 6 - _thisMothn_day.getDay()); //当前循环日期。
  463. if(i==7){
  464. let tf = tdy.getTime()>= _thisMothn_day.getTime() && tdy.getTime() <= _thisMothn_lastDay.getTime() ?true:false;
  465. if(!tf){
  466. ishs = false;
  467. break;
  468. }
  469. }
  470. }
  471. for(let i=1 ;i <43;i++){
  472. var Day = null;
  473. if(!ishs){
  474. Day = new Date(_thisYear, _thisMothn, i + 1 - _thisMothn_day.getDay()); //当前循环日期。
  475. }else{
  476. Day = new Date(_thisYear, _thisMothn, i - 6 - _thisMothn_day.getDay()); //当前循环日期。
  477. }
  478. let dstr = Day.getFullYear() + "-" + (Day.getMonth()+1) + "-" + Day.getDate();
  479. let TxtIndex = this.txtdateArray.findIndex(item=>{
  480. return item.date == dstr
  481. })
  482. dateArray.push({
  483. year:Day.getFullYear(),//年
  484. month:Day.getMonth()+1,//月1-12
  485. week:week[Day.getDay()],//周的数字1~7
  486. week_text:text_week[Day.getDay()],//周的中文
  487. day:Day.getDate(),//几号
  488. prevMoth: Day.getTime() < _thisMothn_day.getTime() ?true:false,//是否是上月。
  489. nowMonth: Day.getTime()>= _thisMothn_day.getTime() && Day.getTime() <= _thisMothn_lastDay.getTime() ?true:false,//是否当月
  490. nowDay:Day.getTime() == _thisDayDate.getTime() ?true:false,//是否是当天。
  491. nextMoth: Day.getTime() > _thisMothn_lastDay.getTime()?true:false,//是否下月
  492. beginEnd: Day.getTime() >= this.start_time.getTime() && Day.getTime() <= this.end_time.getTime()?true:false,//是否在开始和结束区间范围内。
  493. nongli:this.nongli(Day.getFullYear(),Day.getMonth()+1,Day.getDate()),
  494. text:TxtIndex>-1? this.txtdateArray[TxtIndex]['text']:""
  495. })
  496. }
  497. return dateArray;
  498. }
  499. }
  500. export default calendar;