@nocobase/plugin-calendar 2.1.0-beta.32 → 2.1.0-beta.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client-v2.d.ts +2 -0
- package/client-v2.js +3 -0
- package/dist/client/calendar/utils.d.ts +1 -3
- package/dist/client/index.js +1 -1
- package/dist/client-v2/110.5d832243d7f309cc.js +10 -0
- package/dist/client-v2/701.ab4233a614cd3e0a.js +10 -0
- package/dist/client-v2/82.7b76afd4bcb77bb9.js +10 -0
- package/dist/client-v2/944.f4b4f1ca02f36c49.js +10 -0
- package/dist/client-v2/952.8117af037dabbb79.js +10 -0
- package/dist/client-v2/953.6fd23a3f18022252.js +10 -0
- package/dist/{client/models/components/style.d.ts → client-v2/index.d.ts} +2 -2
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +10 -0
- package/dist/{client → client-v2}/models/CalendarBlockModel.d.ts +1 -1
- package/dist/{client → client-v2}/models/actions/CalendarActionModels.d.ts +1 -1
- package/dist/{client → client-v2}/models/components/CalendarBlock.d.ts +2 -0
- package/dist/client-v2/models/components/dateTimeUtils.d.ts +9 -0
- package/dist/client-v2/models/components/getLabelFormatValue.d.ts +11 -0
- package/dist/client-v2/models/components/global.style.d.ts +11 -0
- package/dist/client-v2/models/components/lazy.d.ts +11 -0
- package/dist/client-v2/models/components/style.d.ts +471 -0
- package/dist/client-v2/models/components/useCalendarHeight.d.ts +15 -0
- package/dist/client-v2/plugin.d.ts +53 -0
- package/dist/externalVersion.js +9 -8
- package/dist/node_modules/solarlunar-es/LICENSE +21 -0
- package/dist/node_modules/solarlunar-es/dist/solarlunar.cjs.js +1 -0
- package/dist/node_modules/solarlunar-es/dist/solarlunar.d.ts +145 -0
- package/dist/node_modules/solarlunar-es/dist/solarlunar.esm.js +1 -0
- package/dist/node_modules/solarlunar-es/package.json +1 -0
- package/dist/shared/calendar.d.ts +17 -0
- package/dist/shared/calendar.js +70 -0
- package/package.json +2 -2
- /package/dist/{client → client-v2}/models/actions/CalendarPopupModels.d.ts +0 -0
- /package/dist/{client → client-v2}/models/components/CalendarHeader.d.ts +0 -0
- /package/dist/{client → client-v2}/models/components/CalendarToolbar.d.ts +0 -0
- /package/dist/{client → client-v2}/models/components/CalendarViewContext.d.ts +0 -0
- /package/dist/{client → client-v2}/models/components/index.d.ts +0 -0
- /package/dist/{client → client-v2}/models/index.d.ts +0 -0
- /package/dist/{client → client-v2}/models/utils.d.ts +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
declare interface Solar2lunar {
|
|
2
|
+
lYear: number;
|
|
3
|
+
lMonth: number;
|
|
4
|
+
lDay: number;
|
|
5
|
+
animal: string;
|
|
6
|
+
monthCn: string;
|
|
7
|
+
dayCn: string;
|
|
8
|
+
cYear: number;
|
|
9
|
+
cMonth: number;
|
|
10
|
+
cDay: number;
|
|
11
|
+
gzYear: string;
|
|
12
|
+
gzMonth: string;
|
|
13
|
+
gzDay: string;
|
|
14
|
+
isToday: boolean;
|
|
15
|
+
isLeap: boolean;
|
|
16
|
+
nWeek: number;
|
|
17
|
+
ncWeek: string;
|
|
18
|
+
isTerm: boolean;
|
|
19
|
+
term: string;
|
|
20
|
+
lunarFestival: string;
|
|
21
|
+
festival: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @1900-2100区间内的公历、农历互转
|
|
26
|
+
* @charset UTF-8
|
|
27
|
+
* @author Ajing(JJonline@JJonline.Cn)
|
|
28
|
+
* @Time 2014-7-21
|
|
29
|
+
* @Version $ID$
|
|
30
|
+
* @公历转农历:solarLunar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0]
|
|
31
|
+
* @农历转公历:solarLunar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0]
|
|
32
|
+
* @link http://blog.jjonline.cn/userInterFace/173.html
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
declare const solarLunar: {
|
|
36
|
+
lunarInfo: number[];
|
|
37
|
+
solarMonth: number[];
|
|
38
|
+
gan: string[];
|
|
39
|
+
zhi: string[];
|
|
40
|
+
animals: string[];
|
|
41
|
+
lunarTerm: string[];
|
|
42
|
+
lTermInfo: string[];
|
|
43
|
+
nStr1: string[];
|
|
44
|
+
nStr2: string[];
|
|
45
|
+
nStr3: string[];
|
|
46
|
+
nStr4: string[];
|
|
47
|
+
/**
|
|
48
|
+
* 返回农历y年一整年的总天数
|
|
49
|
+
* @param lunar Year
|
|
50
|
+
* @return Number
|
|
51
|
+
* @eg:var count = solarLunar.lYearDays(1987) ;//count=387
|
|
52
|
+
*/
|
|
53
|
+
lYearDays: (y: number) => number;
|
|
54
|
+
/**
|
|
55
|
+
* 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
|
|
56
|
+
* @param lunar Year
|
|
57
|
+
* @return Number (0-12)
|
|
58
|
+
* @eg:var leapMonth = solarLunar.leapMonth(1987) ;//leapMonth=6
|
|
59
|
+
*/
|
|
60
|
+
leapMonth: (y: number) => number;
|
|
61
|
+
/**
|
|
62
|
+
* 返回农历y年闰月的天数 若该年没有闰月则返回0
|
|
63
|
+
* @param lunar Year
|
|
64
|
+
* @return Number (0、29、30)
|
|
65
|
+
* @eg:var leapMonthDay = solarLunar.leapDays(1987) ;//leapMonthDay=29
|
|
66
|
+
*/
|
|
67
|
+
leapDays: (y: number) => number;
|
|
68
|
+
/**
|
|
69
|
+
* 返回农历 y 年 m 月(非闰月)的总天数,计算 m 为闰月时的天数请使用 leapDays 方法
|
|
70
|
+
* @param lunar Year
|
|
71
|
+
* @return Number (-1、29、30)
|
|
72
|
+
* @eg:var MonthDay = solarLunar.monthDays(1987,9) ;//MonthDay=29
|
|
73
|
+
*/
|
|
74
|
+
monthDays: (y: number, m: number) => number;
|
|
75
|
+
/**
|
|
76
|
+
* 返回公历(!)y年m月的天数
|
|
77
|
+
* @param solar Year
|
|
78
|
+
* @return Number (-1、28、29、30、31)
|
|
79
|
+
* @eg:var solarMonthDay = solarLunar.leapDays(1987) ;//solarMonthDay=30
|
|
80
|
+
*/
|
|
81
|
+
solarDays: (y: number, m: number) => number;
|
|
82
|
+
/**
|
|
83
|
+
* 传入offset偏移量返回干支
|
|
84
|
+
* @param offset 相对甲子的偏移量
|
|
85
|
+
* @return Cn string
|
|
86
|
+
*/
|
|
87
|
+
toGanZhi: (offset: number) => string;
|
|
88
|
+
/**
|
|
89
|
+
* 传入公历(!) y 年获得该年第 n 个节气的公历日期
|
|
90
|
+
* @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
|
|
91
|
+
* @return number Number
|
|
92
|
+
* @eg:var _24 = solarLunar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
|
|
93
|
+
*/
|
|
94
|
+
getTerm: (y: number, n: number) => number;
|
|
95
|
+
/**
|
|
96
|
+
* 传入农历年份数字返回汉语通俗表示法
|
|
97
|
+
* @param lunar year
|
|
98
|
+
* @return string
|
|
99
|
+
* @eg:
|
|
100
|
+
*/
|
|
101
|
+
toChinaYear: (y: number) => string;
|
|
102
|
+
/**
|
|
103
|
+
* 传入农历数字月份返回汉语通俗表示法
|
|
104
|
+
* @param lunar month
|
|
105
|
+
* @return number string
|
|
106
|
+
* @eg:var cnMonth = solarLunar.toChinaMonth(12) ;//cnMonth='腊月'
|
|
107
|
+
*/
|
|
108
|
+
toChinaMonth: (m: number) => string | number;
|
|
109
|
+
/**
|
|
110
|
+
* 传入农历日期数字返回汉字表示法
|
|
111
|
+
* @param lunar day
|
|
112
|
+
* @return Cn string
|
|
113
|
+
* @eg:var cnDay = solarLunar.toChinaDay(21) ;//cnMonth='廿一'
|
|
114
|
+
*/
|
|
115
|
+
toChinaDay: (d: number) => string;
|
|
116
|
+
/**
|
|
117
|
+
* 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
|
|
118
|
+
* @param y year
|
|
119
|
+
* @return Cn string
|
|
120
|
+
* @eg:var animal = solarLunar.getAnimal(1987) ;//animal='兔'
|
|
121
|
+
* todo 生肖需要精确转换
|
|
122
|
+
*/
|
|
123
|
+
getAnimal: (y: number) => string;
|
|
124
|
+
/**
|
|
125
|
+
* 传入公历年月日获得详细的公历、农历object信息 <=>JSON
|
|
126
|
+
* @param y solar year
|
|
127
|
+
* @param m solar month
|
|
128
|
+
* @param d solar day
|
|
129
|
+
* @return JSON object
|
|
130
|
+
* @eg:console.log(solarLunar.solar2lunar(1987,11,01));
|
|
131
|
+
*/
|
|
132
|
+
solar2lunar: (y: number, m: number, d: number) => Solar2lunar | number;
|
|
133
|
+
/**
|
|
134
|
+
* 传入公历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
|
|
135
|
+
* @param y lunar year
|
|
136
|
+
* @param m lunar month
|
|
137
|
+
* @param d lunar day
|
|
138
|
+
* @param isLeapMonth lunar month is leap or not.
|
|
139
|
+
* @return JSON object
|
|
140
|
+
* @eg:console.log(solarLunar.lunar2solar(1987,9,10));
|
|
141
|
+
*/
|
|
142
|
+
lunar2solar: (y: number, m: number, d: number, isLeapMonth: boolean) => Solar2lunar | number;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export { solarLunar as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b={1:{1:"春节",15:"元宵"},2:{2:"龙抬头"},5:{5:"端午"},7:{7:"七夕",15:"中元"},8:{15:"中秋"},9:{9:"重阳"},12:{29:"除夕",30:"除夕"}};var f={1:{1:"元旦"},2:{14:"情人节"},3:{8:"妇女节"},4:{1:"愚人节",4:"清明节"},5:{1:"劳动节",4:"青年节"},6:{1:"儿童节"},7:{1:"建党节"},8:{1:"建军节"},9:{10:"教师节"},10:{1:"国庆节"}};const c={lunarInfo:[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,42416,83315,21168,43432,59728,27296,44710,43856,19296,43748,42352,21088,62051,55632,23383,22176,38608,19925,19152,42192,54484,53840,54616,46400,46752,103846,38320,18864,43380,42160,45690,27216,27968,44870,43872,38256,19189,18800,25776,29859,59984,27480,23232,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,19195,19152,42192,118966,53840,54560,56645,46496,22224,21938,18864,42359,42160,43600,111189,27936,44448,84835,37744,18936,18800,25776,92326,59984,27424,108228,43744,37600,53987,51552,54615,54432,55888,23893,22176,42704,21972,21200,43448,43344,46240,46758,44368,21920,43940,42416,21168,45683,26928,29495,27296,44368,84821,19296,42352,21732,53600,59752,54560,55968,92838,22224,19168,43476,42192,53584,62034,54560],solarMonth:[31,28,31,30,31,30,31,31,30,31,30,31],gan:["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],zhi:["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],animals:["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"],lunarTerm:["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"],lTermInfo:["9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c3598082c95f8c965cc920f","97bd0b06bdb0722c965ce1cfcc920f","b027097bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd0b06bdb0722c965ce1cfcc920f","b027097bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd0b06bdb0722c965ce1cfcc920f","b027097bd097c36b0b6fc9274c91aa","9778397bd19801ec9210c965cc920e","97b6b97bd19801ec95f8c965cc920f","97bd09801d98082c95f8e1cfcc920f","97bd097bd097c36b0b6fc9210c8dc2","9778397bd197c36c9210c9274c91aa","97b6b97bd19801ec95f8c965cc920e","97bd09801d98082c95f8e1cfcc920f","97bd097bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c91aa","97b6b97bd19801ec95f8c965cc920e","97bcf97c3598082c95f8e1cfcc920f","97bd097bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c3598082c95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c3598082c95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd097bd07f595b0b6fc920fb0722","9778397bd097c36b0b6fc9210c8dc2","9778397bd19801ec9210c9274c920e","97b6b97bd19801ec95f8c965cc920f","97bd07f5307f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c920e","97b6b97bd19801ec95f8c965cc920f","97bd07f5307f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c91aa","97b6b97bd19801ec9210c965cc920e","97bd07f1487f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c9274c920e","97bcf7f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c91aa","97b6b97bd197c36c9210c9274c920e","97bcf7f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c920e","97b6b7f0e47f531b0723b0b6fb0722","7f0e37f5307f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36b0b70c9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e37f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc9210c8dc2","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0787b0721","7f0e27f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c91aa","97b6b7f0e47f149b0723b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c8dc2","977837f0e37f149b0723b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e37f5307f595b0b0bc920fb0722","7f0e397bd097c35b0b6fc9210c8dc2","977837f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0721","7f0e37f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc9210c8dc2","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f149b0723b0787b0721","7f0e27f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14998082b0723b06bd","7f07e7f0e37f149b0723b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e37f1487f595b0b0bb0b6fb0722","7f0e37f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e37f1487f531b0b0bb0b6fb0722","7f0e37f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e37f1487f531b0b0bb0b6fb0722","7f0e37f0e37f14898082b072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e37f0e37f14898082b072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f149b0723b0787b0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14998082b0723b06bd","7f07e7f0e47f149b0723b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14998082b0723b06bd","7f07e7f0e37f14998083b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14898082b0723b02d5","7f07e7f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e36665b66aa89801e9808297c35","665f67f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e36665b66a449801e9808297c35","665f67f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e36665b66a449801e9808297c35","665f67f0e37f14898082b072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e26665b66a449801e9808297c35","665f67f0e37f1489801eb072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722"],nStr1:["日","一","二","三","四","五","六","七","八","九","十"],nStr2:["初","十","廿","卅"],nStr3:["正","二","三","四","五","六","七","八","九","十","冬","腊"],nStr4:["零","一","二","三","四","五","六","七","八","九","十"],lYearDays:function(b){var f,e=348;for(f=32768;f>8;f>>=1)e+=c.lunarInfo[b-1900]&f?1:0;return e+c.leapDays(b)},leapMonth:function(b){return 15&c.lunarInfo[b-1900]},leapDays:function(b){return c.leapMonth(b)?65536&c.lunarInfo[b-1900]?30:29:0},monthDays:function(b,f){return f>12||f<1?-1:c.lunarInfo[b-1900]&65536>>f?30:29},solarDays:function(b,f){if(f>12||f<1)return-1;var e=f-1;return 1==e?b%4==0&&b%100!=0||b%400==0?29:28:c.solarMonth[e]},toGanZhi:function(b){return c.gan[b%10]+c.zhi[b%12]},getTerm:function(b,f){if(b<1900||b>2100)return-1;if(f<1||f>24)return-1;var e=c.lTermInfo[b-1900],a=[parseInt("0x"+e.substr(0,5)).toString(),parseInt("0x"+e.substr(5,5)).toString(),parseInt("0x"+e.substr(10,5)).toString(),parseInt("0x"+e.substr(15,5)).toString(),parseInt("0x"+e.substr(20,5)).toString(),parseInt("0x"+e.substr(25,5)).toString()],t=[a[0].substr(0,1),a[0].substr(1,2),a[0].substr(3,1),a[0].substr(4,2),a[1].substr(0,1),a[1].substr(1,2),a[1].substr(3,1),a[1].substr(4,2),a[2].substr(0,1),a[2].substr(1,2),a[2].substr(3,1),a[2].substr(4,2),a[3].substr(0,1),a[3].substr(1,2),a[3].substr(3,1),a[3].substr(4,2),a[4].substr(0,1),a[4].substr(1,2),a[4].substr(3,1),a[4].substr(4,2),a[5].substr(0,1),a[5].substr(1,2),a[5].substr(3,1),a[5].substr(4,2)];return parseInt(t[f-1])},toChinaYear:function(b){var f=parseInt((b/1e3).toString()),e=parseInt((b%1e3/100).toString()),a=parseInt((b%100/10).toString()),t=b%10;return c.nStr4[f]+c.nStr4[e]+c.nStr4[a]+c.nStr4[t]+"年"},toChinaMonth:function(b){if(b>12||b<1)return-1;var f=c.nStr3[b-1];return f+="月"},toChinaDay:function(b){var f;switch(b){case 10:f="初十";break;case 20:f="二十";break;case 30:f="三十";break;default:f=c.nStr2[Math.floor(b/10)],f+=c.nStr1[b%10]}return f},getAnimal:function(b){return c.animals[(b-4)%12]},solar2lunar:function(e,a,t){if(e<1900||e>2100)return-1;if(1900==e&&1==a&&t<31)return-1;if(e)r=new Date(e,parseInt(a.toString())-1,t);else var r=new Date;var n,d=0,s=(e=r.getFullYear(),a=r.getMonth()+1,t=r.getDate(),(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate())-Date.UTC(1900,0,31))/864e5);for(n=1900;n<2101&&s>0;n++)s-=d=c.lYearDays(n);s<0&&(s+=d,n--);var u=new Date,o=!1;u.getFullYear()==e&&u.getMonth()+1==a&&u.getDate()==t&&(o=!0);var i=r.getDay(),l=c.nStr1[i];0==i&&(i=7);var h=n,g=c.leapMonth(n),D=!1;for(n=1;n<13&&s>0;n++)g>0&&n==g+1&&0==D?(--n,D=!0,d=c.leapDays(h)):d=c.monthDays(h,n),1==D&&n==g+1&&(D=!1),s-=d;0==s&&g>0&&n==g+1&&(D?D=!1:(D=!0,--n)),s<0&&(s+=d,--n);var v=n,m=s+1,p=a-1,y=c.getTerm(e,3),S=c.toGanZhi(e-4),T=new Date(e,1,y).getTime();new Date(e,p,t).getTime()<T&&(S=c.toGanZhi(e-5));var I=c.getTerm(e,2*a-1),M=c.getTerm(e,2*a),C=c.toGanZhi(12*(e-1900)+a+11);t>=I&&(C=c.toGanZhi(12*(e-1900)+a+12));var Y=!1,w="";I==t&&(Y=!0,w=c.lunarTerm[2*a-2]),M==t&&(Y=!0,w=c.lunarTerm[2*a-1]);var x=Date.UTC(e,p,1,0,0,0,0)/864e5+25567+10,U=c.toGanZhi(x+t-1),G=b[v]&&b[v][m]?b[v][m]:"";[2022,2025,2026,2027,2028,2029,2031,2032].includes(e)&&12===v&&29===m&&(G="除夕");var Z=f[a]&&f[a][t]?f[a][t]:"";return{lYear:h,lMonth:v,lDay:m,animal:c.getAnimal(h),yearCn:c.toChinaYear(h),monthCn:(D&&g===v?"闰":"")+c.toChinaMonth(v),dayCn:c.toChinaDay(m),cYear:e,cMonth:a,cDay:t,gzYear:S,gzMonth:C,gzDay:U,isToday:o,isLeap:D,nWeek:i,ncWeek:"星期"+l,isTerm:Y,term:w,lunarFestival:G,festival:Z}},lunar2solar:function(b,f,e,a){var t=c.leapMonth(b);if(c.leapDays(b),a&&t!=f)return-1;if(2100==b&&12==f&&e>1||1900==b&&1==f&&e<31)return-1;var r=c.monthDays(b,f);if(b<1900||b>2100||e>r)return-1;for(var n=0,d=1900;d<b;d++)n+=c.lYearDays(d);var s=0,u=!1;for(d=1;d<f;d++)s=c.leapMonth(b),u||s<=d&&s>0&&(n+=c.leapDays(b),u=!0),n+=c.monthDays(b,d);a&&(n+=r);var o=Date.UTC(1900,1,30,0,0,0),i=new Date(864e5*(n+e-31)+o),l=i.getUTCFullYear(),h=i.getUTCMonth()+1,g=i.getUTCDate();return c.solar2lunar(l,h,g)}};var e=c;export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"solarlunar-es","version":"1.0.9","description":"一个公历农历转化工具,支持esmodule","main":"./dist/solarlunar.cjs.js","module":"./dist/solarlunar.esm.js","types":"./dist/solarlunar.d.ts","scripts":{"build":"rollup -c","test":"mocha"},"files":["dist"],"keywords":["solarlunar","esm","公历农历转换"],"repository":{"type":"git","url":"https://github.com/qiuquanwu/solarlunar-es"},"author":"qiuquanwu","license":"ISC","devDependencies":{"@babel/core":"^7.12.10","@rollup/plugin-commonjs":"^17.1.0","@rollup/plugin-node-resolve":"^11.1.0","rollup":"^2.38.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-dts":"^4.1.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript":"^1.0.1","typescript":"^4.5.5","chai":"^4.3.6","mocha":"^9.2.1"},"_lastModified":"2026-05-18T17:29:03.796Z"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import dayjs from 'dayjs';
|
|
10
|
+
export declare const toEvents: (data: any[], fieldNames: any, fallbackTitle?: string) => {
|
|
11
|
+
id: any;
|
|
12
|
+
title: any;
|
|
13
|
+
start: Date;
|
|
14
|
+
end: Date;
|
|
15
|
+
}[];
|
|
16
|
+
export declare const getLunarDay: (date: dayjs.Dayjs | string) => string | number;
|
|
17
|
+
export declare const formatDate: (date: dayjs.Dayjs) => string;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var calendar_exports = {};
|
|
38
|
+
__export(calendar_exports, {
|
|
39
|
+
formatDate: () => formatDate,
|
|
40
|
+
getLunarDay: () => getLunarDay,
|
|
41
|
+
toEvents: () => toEvents
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(calendar_exports);
|
|
44
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
45
|
+
var import_lodash = require("lodash");
|
|
46
|
+
var import_solarlunar_es = __toESM(require("solarlunar-es"));
|
|
47
|
+
const toEvents = (data, fieldNames, fallbackTitle = "Untitle") => {
|
|
48
|
+
return data == null ? void 0 : data.map((item) => {
|
|
49
|
+
return {
|
|
50
|
+
id: (0, import_lodash.get)(item, fieldNames.id || "id"),
|
|
51
|
+
title: (0, import_lodash.get)(item, fieldNames.title) || fallbackTitle,
|
|
52
|
+
start: new Date((0, import_lodash.get)(item, fieldNames.start)),
|
|
53
|
+
end: new Date((0, import_lodash.get)(item, fieldNames.end || fieldNames.start))
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const getLunarDay = (date) => {
|
|
58
|
+
const md = (0, import_dayjs.default)(date);
|
|
59
|
+
const result = import_solarlunar_es.default.solar2lunar(md.year(), md.month() + 1, md.date());
|
|
60
|
+
return typeof result !== "number" ? result.lunarFestival || result.term || result.dayCn : result;
|
|
61
|
+
};
|
|
62
|
+
const formatDate = (date) => {
|
|
63
|
+
return date.format("YYYY-MM-DDTHH:mm:ss.SSSZ");
|
|
64
|
+
};
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
formatDate,
|
|
68
|
+
getLunarDay,
|
|
69
|
+
toEvents
|
|
70
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-calendar",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.34",
|
|
4
4
|
"displayName": "Calendar",
|
|
5
5
|
"displayName.ru-RU": "Календарь",
|
|
6
6
|
"displayName.zh-CN": "日历",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
41
41
|
"directory": "packages/plugins/calendar"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "ca804833299c547f8d49f8d58f73273a4bfcd03c",
|
|
44
44
|
"keywords": [
|
|
45
45
|
"Collections",
|
|
46
46
|
"Blocks"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|