filesbox/web/dist/design/designstatic/home/js/simple-calendar.js

2 lines
16 KiB
JavaScript
Raw Normal View History

2024-07-26 06:10:54 +00:00
"use strict";var _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol?"symbol":typeof h},_createClass=function(){function h(n,a){for(var e=0;e<a.length;e++){var t=a[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}return function(n,a,e){return a&&h(n.prototype,a),e&&h(n,e),n}}();function _classCallCheck(h,n){if(!(h instanceof n))throw new TypeError("Cannot call a class as a function")}var LunarHelp=function(){function h(n,a,e){_classCallCheck(this,h),this.lunarInfo=new Array(19416,19168,42352,21717,53856,55632,91476,22176,39632,21970,19168,42422,42192,53840,119381,46400,54944,44450,38320,84343,18800,42160,46261,27216,27968,109396,11104,38256,21234,18800,25958,54432,59984,28309,23248,11104,100067,37600,116951,51536,54432,120998,46416,22176,107956,9680,37584,53938,43344,46423,27808,46416,86869,19872,42448,83315,21200,43432,59728,27296,44710,43856,19296,43748,42352,21088,62051,55632,23383,22176,38608,19925,19152,42192,54484,53840,54616,46400,46496,103846,38320,18864,43380,42160,45690,27216,27968,44870,43872,38256,19189,18800,25776,29859,59984,27480,21952,43872,38613,37600,51552,55636,54432,55888,30034,22176,43959,9680,37584,51893,43344,46240,47780,44368,21977,19360,42416,86390,21168,43312,31060,27296,44368,23378,19296,42726,42208,53856,60005,54576,23200,30371,38608,19415,19152,42192,118966,53840,54560,56645,46496,22224,21938,18864,42359,42160,43600,111189,27936,44448),this.nStr1=new Array("\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341"),this.nStr2=new Array("\u521D","\u5341","\u5EFF","\u4E09");var t=new Date(parseInt(n),parseInt(a)-1,parseInt(e)),r,s=0,l=0,i=new Date(1900,0,31),c=(t-i)/864e5;for(r=1900;r<2050&&c-this.lYearDays(r)>0;r++)c-=this.lYearDays(r);for(this.year=r,s=this.leapMonth(r),this.isLeap=!1,r=1;r<13&&c>0;r++)s>0&&r==s+1&&this.isLeap==!1?(--r,l=this.leapDays(this.year)):l=this.monthDays(this.year,r),this.isLeap==!0&&r==s+1&&(this.isLeap=!1),c-=l;c==0&&s>0&&r==s+1&&(this.isLeap?this.isLeap=!1:(this.isLeap=!0,--r)),c<0&&(c+=l,--r),this.month=r,this.day=c+1}return _createClass(h,[{key:"lYearDays",value:function(a){var e,t=0;for(e=32768;e>8;e>>=1)t+=this.lunarInfo[a-1900]&e?30:29;return t+this.leapDays(a)}},{key:"leapDays",value:function(a){return this.leapMonth(a)?this.lunarInfo[a-1900]&65536?30:29:0}},{key:"leapMonth",value:function(a){return this.lunarInfo[a-1900]&15}},{key:"monthDays",value:function(a,e){return this.lunarInfo[a-1900]&65536>>e?30:29}},{key:"cDay",value:function(a){var e;switch(a){case 10:e="\u521D\u5341";break;case 20:e="\u4E8C\u5341";break;case 30:e="\u4E09\u5341";break;default:e=this.nStr2[Math.floor(a/10)],e+=this.nStr1[parseInt(a%10)]}return e}},{key:"cMonth",value:function(a){var e;switch(a){case 1:e="\u6B63\u6708";break;case 2:e="\u4E8C\u6708";break;case 3:e="\u4E09\u6708";break;case 4:e="\u56DB\u6708";break;case 5:e="\u4E94\u6708";break;case 6:e="\u516D\u6708";break;case 7:e="\u4E03\u6708";break;case 8:e="\u516B\u6708";break;case 9:e="\u4E5D\u6708";break;case 10:e="\u5341\u6708";break;case 11:e="\u5341\u4E00\u6708";break;case 12:e="\u5341\u4E8C\u6708";break;default:break}return e}},{key:"getLunarDay",value:function(){return cMonth(this.month)+cDay(this.day)}},{key:"getLunarDayName",value:function(){return this.day==1?this.cMonth(this.month):this.cDay(this.day)}},{key:"getLunarDayNum",value:function(){return{day:this.day,month:this.month}}}]),h}(),SimpleCalendar=function(){function h(n,a){_classCallCheck(this,h),this._defaultOptions={width:"500px",height:"500px",language:"CH",showLunarCalendar:!0,showHoliday:!0,showFestival:!0,showLunarFestival:!0,showSolarTerm:!0,showMark:!0,timeRange:{startYear:1900,endYear:2049},timeZone:"",mark:{"2016-5-5":"\u4E0A\u5B66"},theme:{changeAble:!1,weeks:{backgroundColor:"#FBEC9C",fontColor:"#4A4A4A",fontSize:"20px"},days:{backgroundColor:"#ffffff",fontColor:"#565555",fontSize:"24px"},todaycolor:"orange",activeSelectColor:"oran