lichta 1.0.0-beta → 1.0.1
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/README.md +110 -104
- package/dist/components/Formatter.svelte +47 -47
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/lunar.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/utils/format.js +23 -4
- package/package.json +16 -5
package/README.md
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
# 🌙 LichTa
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Vietnamese Solar ↔ Lunar Calendar conversion library for JavaScript/TypeScript.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Supports ready-to-use Svelte 5 components, while exporting a pure TypeScript core for React, Vue, Angular, and vanilla JS.
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/lichta)
|
|
8
|
-
[](https://github.com/
|
|
8
|
+
[](https://github.com/zeforc/lichta/blob/main/LICENSE)
|
|
9
|
+
|
|
10
|
+
🚀 **[Live Demo](https://lich-ta.vercel.app/)**
|
|
11
|
+
|
|
12
|
+
> 🇻🇳 [Phiên bản Tiếng Việt (Vietnamese version)](./README.vi.md)
|
|
9
13
|
|
|
10
14
|
---
|
|
11
15
|
|
|
12
|
-
## ✨
|
|
16
|
+
## ✨ Features
|
|
13
17
|
|
|
14
|
-
- 🔄 **
|
|
15
|
-
- 🐉 **Can Chi** —
|
|
16
|
-
- 🔮 **Ngũ Hành
|
|
17
|
-
- ⏰ **Giờ Hoàng Đạo** — 6
|
|
18
|
-
- 📅 **Calendar Component** —
|
|
19
|
-
- 🎨 **Format** —
|
|
20
|
-
- 🌐 **i18n** —
|
|
18
|
+
- 🔄 **Solar ↔ Lunar Conversion** — Ho Ngoc Duc algorithm (range 1800–2199)
|
|
19
|
+
- 🐉 **Sexagenary Cycle (Can Chi)** — Calculate Can Chi for year, month, day, and hour
|
|
20
|
+
- 🔮 **Five Elements (Ngũ Hành)** — Calculate destiny element based on birth year
|
|
21
|
+
- ⏰ **Auspicious Hours (Giờ Hoàng Đạo)** — 6 auspicious hours in a day
|
|
22
|
+
- 📅 **Calendar Component** — Svelte 5 monthly calendar with lunar dates
|
|
23
|
+
- 🎨 **Format** — Display traditional lunar dates (Mùng Một tháng Giêng...)
|
|
24
|
+
- 🌐 **i18n** — Vietnamese–English–Japanese–Korean support (vi, en, ja, ko)
|
|
21
25
|
- 📦 **Multi-framework** — Svelte 5, React, Vue, Angular, vanilla JS
|
|
22
26
|
|
|
23
27
|
---
|
|
24
28
|
|
|
25
|
-
## 📦
|
|
29
|
+
## 📦 Installation
|
|
26
30
|
|
|
27
31
|
```bash
|
|
28
32
|
npm install lichta
|
|
@@ -30,16 +34,16 @@ npm install lichta
|
|
|
30
34
|
|
|
31
35
|
---
|
|
32
36
|
|
|
33
|
-
## 🚀
|
|
37
|
+
## 🚀 Usage
|
|
34
38
|
|
|
35
|
-
### Core Logic (
|
|
39
|
+
### Core Logic (Any framework)
|
|
36
40
|
|
|
37
|
-
Import
|
|
41
|
+
Import from `lichta/core` to use **pure TypeScript** — no Svelte dependency:
|
|
38
42
|
|
|
39
43
|
```typescript
|
|
40
44
|
import { LichTa, getYearDetails } from 'lichta/core';
|
|
41
45
|
|
|
42
|
-
//
|
|
46
|
+
// Solar → Lunar
|
|
43
47
|
const lunar = LichTa.toLunar(10, 2, 2024);
|
|
44
48
|
// → {
|
|
45
49
|
// day: 1, month: 1, year: 2024,
|
|
@@ -50,122 +54,124 @@ const lunar = LichTa.toLunar(10, 2, 2024);
|
|
|
50
54
|
// jd: 2460350
|
|
51
55
|
// }
|
|
52
56
|
|
|
53
|
-
//
|
|
57
|
+
// Lunar → Solar
|
|
54
58
|
const solar = LichTa.toSolar(1, 1, 2024, false);
|
|
55
59
|
// → { day: 10, month: 2, year: 2024 }
|
|
56
60
|
|
|
57
|
-
//
|
|
61
|
+
// Custom timezone (default is GMT+7)
|
|
58
62
|
const lunarChina = LichTa.toLunar(10, 2, 2024, 8); // GMT+8
|
|
59
63
|
```
|
|
60
64
|
|
|
61
|
-
### Can Chi & Phong Thủy
|
|
65
|
+
### Sexagenary Cycle & Feng Shui (Can Chi & Phong Thủy)
|
|
62
66
|
|
|
63
67
|
```typescript
|
|
64
|
-
import {
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
import {
|
|
69
|
+
getYearDetails,
|
|
70
|
+
getDayCanChi,
|
|
71
|
+
getMonthCanChi,
|
|
72
|
+
getHourCanChi,
|
|
73
|
+
getAuspiciousHours
|
|
74
|
+
} from 'lichta/core';
|
|
75
|
+
|
|
76
|
+
// Can Chi + Element for the year
|
|
67
77
|
getYearDetails(2024);
|
|
68
78
|
// → { can: 'Giáp', chi: 'Thìn', menh: 'Hỏa',
|
|
69
79
|
// fullString: 'Giáp Thìn - Mệnh Hỏa' }
|
|
70
80
|
|
|
71
|
-
// Can Chi
|
|
81
|
+
// Day Can Chi (requires Julian Day Number)
|
|
72
82
|
const lunar = LichTa.toLunar(10, 2, 2024);
|
|
73
|
-
getDayCanChi(lunar.jd);
|
|
83
|
+
getDayCanChi(lunar.jd); // → 'Giáp Tý'
|
|
74
84
|
|
|
75
|
-
// Can Chi
|
|
76
|
-
getMonthCanChi(1, 2024); // →
|
|
85
|
+
// Month Can Chi
|
|
86
|
+
getMonthCanChi(1, 2024); // → month Giêng year Giáp Thìn
|
|
77
87
|
|
|
78
|
-
// Can Chi
|
|
79
|
-
getHourCanChi(8, lunar.jd); // →
|
|
88
|
+
// Hour Can Chi
|
|
89
|
+
getHourCanChi(8, lunar.jd); // → hour Thìn (7h-9h)
|
|
80
90
|
|
|
81
|
-
//
|
|
91
|
+
// Auspicious Hours
|
|
82
92
|
getAuspiciousHours(lunar.jd);
|
|
83
93
|
// → ['Tý', 'Sửu', 'Mão', 'Ngọ', 'Mùi', 'Dậu']
|
|
84
94
|
```
|
|
85
95
|
|
|
86
|
-
### Format &
|
|
96
|
+
### Format & Display
|
|
87
97
|
|
|
88
98
|
```typescript
|
|
89
99
|
import { formatTraditional, formatLunarDate, getMonthName, getDayName } from 'lichta/utils';
|
|
90
100
|
|
|
91
101
|
const lunar = LichTa.toLunar(10, 2, 2024);
|
|
92
102
|
|
|
93
|
-
//
|
|
103
|
+
// Traditional format
|
|
94
104
|
formatTraditional(lunar);
|
|
95
105
|
// → 'Mùng Một tháng Giêng năm Giáp Thìn'
|
|
96
106
|
|
|
97
|
-
//
|
|
98
|
-
formatLunarDate(lunar, 'dd/MM/yyyy');
|
|
99
|
-
formatLunarDate(lunar, 'CC');
|
|
100
|
-
formatLunarDate(lunar, 'Ngày DC');
|
|
107
|
+
// Pattern format
|
|
108
|
+
formatLunarDate(lunar, 'dd/MM/yyyy'); // → '01/01/2024'
|
|
109
|
+
formatLunarDate(lunar, 'CC'); // → 'Giáp Thìn'
|
|
110
|
+
formatLunarDate(lunar, 'Ngày DC'); // → 'Ngày Giáp Tý'
|
|
101
111
|
|
|
102
|
-
//
|
|
103
|
-
getMonthName(1);
|
|
112
|
+
// Traditional names
|
|
113
|
+
getMonthName(1); // → 'Giêng'
|
|
104
114
|
getMonthName(12); // → 'Chạp'
|
|
105
|
-
getDayName(1);
|
|
106
|
-
getDayName(15);
|
|
107
|
-
getDayName(30);
|
|
115
|
+
getDayName(1); // → 'Mùng Một'
|
|
116
|
+
getDayName(15); // → 'Rằm'
|
|
117
|
+
getDayName(30); // → 'Ba Mươi'
|
|
108
118
|
```
|
|
109
119
|
|
|
110
120
|
**Format tokens:**
|
|
111
121
|
|
|
112
|
-
| Token |
|
|
113
|
-
|
|
114
|
-
| `dd` |
|
|
115
|
-
| `d` |
|
|
116
|
-
| `MM` |
|
|
117
|
-
| `M` |
|
|
118
|
-
| `yyyy` |
|
|
119
|
-
| `yy` |
|
|
120
|
-
| `CC` | Can Chi
|
|
121
|
-
| `DC` | Can Chi
|
|
122
|
-
| `MC` | Can Chi
|
|
123
|
-
| `L` | "Nhuận"
|
|
122
|
+
| Token | Description | Example |
|
|
123
|
+
| ------ | --------------------- | --------- |
|
|
124
|
+
| `dd` | 2-digit day | 01, 15 |
|
|
125
|
+
| `d` | Day | 1, 15 |
|
|
126
|
+
| `MM` | 2-digit month | 01, 12 |
|
|
127
|
+
| `M` | Month | 1, 12 |
|
|
128
|
+
| `yyyy` | 4-digit year | 2024 |
|
|
129
|
+
| `yy` | Last 2 digits of year | 24 |
|
|
130
|
+
| `CC` | Year Can Chi | Giáp Thìn |
|
|
131
|
+
| `DC` | Day Can Chi | Giáp Tý |
|
|
132
|
+
| `MC` | Month Can Chi | Bính Dần |
|
|
133
|
+
| `L` | "Nhuận" if leap month | Nhuận |
|
|
124
134
|
|
|
125
135
|
### Svelte 5 Components
|
|
126
136
|
|
|
127
137
|
```svelte
|
|
128
138
|
<script>
|
|
129
|
-
|
|
139
|
+
import { Calendar, Formatter } from 'lichta';
|
|
130
140
|
</script>
|
|
131
141
|
|
|
132
|
-
<!--
|
|
133
|
-
<Calendar
|
|
134
|
-
showLunar={true}
|
|
135
|
-
locale="vi"
|
|
136
|
-
onSelect={(date, lunar) => console.log(date, lunar)}
|
|
137
|
-
/>
|
|
142
|
+
<!-- Full monthly calendar -->
|
|
143
|
+
<Calendar showLunar={true} locale="vi" onSelect={(date, lunar) => console.log(date, lunar)} />
|
|
138
144
|
|
|
139
|
-
<!--
|
|
145
|
+
<!-- Lunar date formatter -->
|
|
140
146
|
<Formatter date={new Date()} />
|
|
141
147
|
```
|
|
142
148
|
|
|
143
149
|
#### Calendar Props
|
|
144
150
|
|
|
145
|
-
| Prop | Type
|
|
146
|
-
|
|
147
|
-
| `month` | `number`
|
|
148
|
-
| `year` | `number`
|
|
149
|
-
| `selectedDate` | `Date \| null`
|
|
150
|
-
| `onSelect` | `(date: Date, lunar: LunarDate) => void`
|
|
151
|
-
| `showLunar` | `boolean`
|
|
152
|
-
| `locale` | `'vi' \| 'en' \| 'ja' \| 'ko'`
|
|
153
|
-
| `dayCell` | `Snippet`
|
|
151
|
+
| Prop | Type | Default | Description |
|
|
152
|
+
| -------------- | ---------------------------------------- | ------------- | --------------------------- |
|
|
153
|
+
| `month` | `number` | Current month | Displayed month (1-12) |
|
|
154
|
+
| `year` | `number` | Current year | Displayed year |
|
|
155
|
+
| `selectedDate` | `Date \| null` | `null` | Selected date |
|
|
156
|
+
| `onSelect` | `(date: Date, lunar: LunarDate) => void` | — | Callback on date select |
|
|
157
|
+
| `showLunar` | `boolean` | `true` | Show lunar dates |
|
|
158
|
+
| `locale` | `'vi' \| 'en' \| 'ja' \| 'ko'` | `'vi'` | Language |
|
|
159
|
+
| `dayCell` | `Snippet` | — | Custom snippet for day cell |
|
|
154
160
|
|
|
155
161
|
#### Theming
|
|
156
162
|
|
|
157
|
-
Calendar
|
|
163
|
+
The Calendar supports CSS custom properties:
|
|
158
164
|
|
|
159
165
|
```css
|
|
160
166
|
:root {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
--lichta-primary: #d4a373;
|
|
168
|
+
--lichta-bg: #fffcf7;
|
|
169
|
+
--lichta-text: #2c1810;
|
|
170
|
+
--lichta-today-bg: #d4a373;
|
|
171
|
+
--lichta-selected-bg: #a0522d;
|
|
172
|
+
--lichta-lunar-text: #b08968;
|
|
173
|
+
--lichta-radius: 8px;
|
|
174
|
+
--lichta-font: 'Inter', sans-serif;
|
|
169
175
|
}
|
|
170
176
|
```
|
|
171
177
|
|
|
@@ -174,24 +180,24 @@ Calendar hỗ trợ CSS custom properties:
|
|
|
174
180
|
```typescript
|
|
175
181
|
import { t, getZodiacAnimal } from 'lichta';
|
|
176
182
|
|
|
177
|
-
//
|
|
183
|
+
// Get dictionary
|
|
178
184
|
const vi = t('vi');
|
|
179
|
-
vi.heavenlyStems;
|
|
185
|
+
vi.heavenlyStems; // ['Giáp', 'Ất', ...]
|
|
180
186
|
vi.earthlyBranches; // ['Tý', 'Sửu', ...]
|
|
181
|
-
vi.fiveElements;
|
|
182
|
-
vi.monthNames;
|
|
187
|
+
vi.fiveElements; // ['Kim', 'Mộc', 'Thủy', 'Hỏa', 'Thổ']
|
|
188
|
+
vi.monthNames; // ['Giêng', 'Hai', ..., 'Chạp']
|
|
183
189
|
|
|
184
190
|
const en = t('en');
|
|
185
|
-
en.fiveElements;
|
|
186
|
-
en.zodiacAnimals;
|
|
191
|
+
en.fiveElements; // ['Metal', 'Wood', 'Water', 'Fire', 'Earth']
|
|
192
|
+
en.zodiacAnimals; // ['Rat', 'Ox', 'Tiger', ...]
|
|
187
193
|
|
|
188
194
|
const ja = t('ja');
|
|
189
|
-
ja.weekDays;
|
|
195
|
+
ja.weekDays; // ['日', '月', '火', '水', '木', '金', '土']
|
|
190
196
|
|
|
191
197
|
const ko = t('ko');
|
|
192
|
-
ko.fiveElements;
|
|
198
|
+
ko.fiveElements; // ['금', '목', '수', '화', '토']
|
|
193
199
|
|
|
194
|
-
//
|
|
200
|
+
// Zodiac animal by year
|
|
195
201
|
getZodiacAnimal(0, 'vi'); // → 'Chuột'
|
|
196
202
|
getZodiacAnimal(4, 'en'); // → 'Dragon'
|
|
197
203
|
getZodiacAnimal(0, 'ja'); // → '鼠'
|
|
@@ -201,35 +207,35 @@ getZodiacAnimal(0, 'ja'); // → '鼠'
|
|
|
201
207
|
|
|
202
208
|
## 📁 Import Paths
|
|
203
209
|
|
|
204
|
-
| Path
|
|
205
|
-
|
|
206
|
-
| `lichta`
|
|
207
|
-
| `lichta/core`
|
|
208
|
-
| `lichta/utils`
|
|
210
|
+
| Path | Content | Used for |
|
|
211
|
+
| -------------- | ---------------------------- | ---------------------------- |
|
|
212
|
+
| `lichta` | Full API + Svelte components | Svelte 5 projects |
|
|
213
|
+
| `lichta/core` | Pure TypeScript logic | React, Vue, Angular, vanilla |
|
|
214
|
+
| `lichta/utils` | Format utilities | Any framework |
|
|
209
215
|
|
|
210
216
|
```typescript
|
|
211
|
-
// Svelte 5 — import
|
|
217
|
+
// Svelte 5 — import everything
|
|
212
218
|
import { LichTa, Calendar, Formatter, formatTraditional } from 'lichta';
|
|
213
219
|
|
|
214
|
-
// React / Vue / Angular —
|
|
220
|
+
// React / Vue / Angular — import core logic only
|
|
215
221
|
import { LichTa, getYearDetails } from 'lichta/core';
|
|
216
222
|
import { formatTraditional, getDayName } from 'lichta/utils';
|
|
217
223
|
```
|
|
218
224
|
|
|
219
225
|
---
|
|
220
226
|
|
|
221
|
-
## 📐
|
|
227
|
+
## 📐 Algorithm
|
|
222
228
|
|
|
223
|
-
LichTa
|
|
229
|
+
LichTa uses the lunar conversion algorithm by **Ho Ngoc Duc** (Leipzig University), based on:
|
|
224
230
|
|
|
225
|
-
- **Julian Day Number** —
|
|
226
|
-
-
|
|
227
|
-
- **
|
|
228
|
-
- **Jean Meeus, "Astronomical Algorithms"** —
|
|
231
|
+
- **Julian Day Number** — Continuous day coordinate system for astronomical calculations
|
|
232
|
+
- **New Moon** — Determines the 1st day of the lunar month
|
|
233
|
+
- **Solar Terms** — Determines months and leap months
|
|
234
|
+
- **Jean Meeus, "Astronomical Algorithms"** — Precise astronomical formulas
|
|
229
235
|
|
|
230
|
-
**
|
|
236
|
+
**Range**: 1800 – 2199 | **Default timezone**: GMT+7 (Vietnam)
|
|
231
237
|
|
|
232
|
-
|
|
238
|
+
See details in [docs/ALGORITHM.md](./docs/ALGORITHM.md).
|
|
233
239
|
|
|
234
240
|
---
|
|
235
241
|
|
|
@@ -241,5 +247,5 @@ Xem chi tiết trong [docs/ALGORITHM.md](./docs/ALGORITHM.md).
|
|
|
241
247
|
|
|
242
248
|
## 🙏 Credits
|
|
243
249
|
|
|
244
|
-
- **
|
|
245
|
-
- **Jean Meeus** —
|
|
250
|
+
- **Ho Ngoc Duc** — Original algorithm ([informatik.uni-leipzig.de](http://www.informatik.uni-leipzig.de/~duc/amlich/))
|
|
251
|
+
- **Jean Meeus** — _Astronomical Algorithms_ (1998)
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { LichTa } from '../core/lunar.js';
|
|
3
|
+
import type { LunarDate } from '../core/types.js';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
// Props nhận vào từ consumer ứng dụng
|
|
7
|
+
interface Props {
|
|
8
|
+
date?: Date;
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
}
|
|
11
|
+
let { date = new Date(), children }: Props = $props();
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
// Khai báo biến reactive tự động tính toán lại khi `date` thay đổi
|
|
14
|
+
let lunar: LunarDate = $derived.by(() => {
|
|
15
|
+
const d = date.getDate();
|
|
16
|
+
const m = date.getMonth() + 1; // Tháng trong JS tính từ 0
|
|
17
|
+
const y = date.getFullYear();
|
|
18
|
+
return LichTa.toLunar(d, m, y);
|
|
19
|
+
});
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<div class="lich-ta-formatter">
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
<div class="lunar-display-banner">
|
|
24
|
+
<span class="lunar-date">Ngày {lunar.day} tháng {lunar.month} (Âm lịch)</span>
|
|
25
|
+
<span class="can-chi-details">Năm {lunar.yearCanChi}</span>
|
|
26
|
+
</div>
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
<div class="control-slot-wrapper">
|
|
29
|
+
{@render children?.()}
|
|
30
|
+
</div>
|
|
31
31
|
</div>
|
|
32
32
|
|
|
33
33
|
<style>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
</style>
|
|
34
|
+
.lich-ta-formatter {
|
|
35
|
+
display: block;
|
|
36
|
+
width: 100%;
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
}
|
|
39
|
+
.lunar-display-banner {
|
|
40
|
+
padding: 12px;
|
|
41
|
+
background-color: #fcfaf7;
|
|
42
|
+
border-left: 4px solid #d4a373;
|
|
43
|
+
margin-bottom: 16px;
|
|
44
|
+
}
|
|
45
|
+
.lunar-date {
|
|
46
|
+
display: block;
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
font-size: 1.1rem;
|
|
49
|
+
color: #1a1a1a;
|
|
50
|
+
}
|
|
51
|
+
.can-chi-details {
|
|
52
|
+
display: block;
|
|
53
|
+
font-size: 0.9rem;
|
|
54
|
+
color: #666666;
|
|
55
|
+
margin-top: 4px;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { LichTa, jdFromDate, jdToDate, getNewMoonDay, getSunLongitude } from './lunar.js';
|
|
2
|
-
export { getYearDetails, getDayCanChi, getMonthCanChi, getHourCanChi, getAuspiciousHours
|
|
2
|
+
export { getYearDetails, getDayCanChi, getMonthCanChi, getHourCanChi, getAuspiciousHours } from './feng-shui.js';
|
|
3
3
|
export type { LunarDate, SolarDate } from './types.js';
|
package/dist/core/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Xuất bản phần lõi TypeScript — KHÔNG có Svelte dependencies
|
|
2
2
|
// Dành cho React, Vue, Angular, vanilla JS consumers
|
|
3
3
|
export { LichTa, jdFromDate, jdToDate, getNewMoonDay, getSunLongitude } from './lunar.js';
|
|
4
|
-
export { getYearDetails, getDayCanChi, getMonthCanChi, getHourCanChi, getAuspiciousHours
|
|
4
|
+
export { getYearDetails, getDayCanChi, getMonthCanChi, getHourCanChi, getAuspiciousHours } from './feng-shui.js';
|
package/dist/core/lunar.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { LichTa, jdFromDate, jdToDate } from './core/lunar.js';
|
|
2
2
|
export type { LunarDate, SolarDate } from './core/types.js';
|
|
3
|
-
export { getYearDetails, getDayCanChi, getMonthCanChi, getHourCanChi, getAuspiciousHours
|
|
3
|
+
export { getYearDetails, getDayCanChi, getMonthCanChi, getHourCanChi, getAuspiciousHours } from './core/feng-shui.js';
|
|
4
4
|
export { formatLunarDate, formatTraditional, getMonthName, getDayName } from './utils/format.js';
|
|
5
5
|
export { t, getZodiacAnimal } from './constants/i18n.js';
|
|
6
6
|
export type { Locale } from './constants/i18n.js';
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Xuất bản phần lõi TypeScript (Cho những ai chỉ muốn dùng logic toán học)
|
|
5
5
|
export { LichTa, jdFromDate, jdToDate } from './core/lunar.js';
|
|
6
6
|
// Xuất bản phần phong thủy
|
|
7
|
-
export { getYearDetails, getDayCanChi, getMonthCanChi, getHourCanChi, getAuspiciousHours
|
|
7
|
+
export { getYearDetails, getDayCanChi, getMonthCanChi, getHourCanChi, getAuspiciousHours } from './core/feng-shui.js';
|
|
8
8
|
// Xuất bản phần format/tiện ích
|
|
9
9
|
export { formatLunarDate, formatTraditional, getMonthName, getDayName } from './utils/format.js';
|
|
10
10
|
// Xuất bản phần i18n
|
package/dist/utils/format.js
CHANGED
|
@@ -3,13 +3,32 @@
|
|
|
3
3
|
// ============================================================
|
|
4
4
|
/** Tên tháng âm lịch truyền thống */
|
|
5
5
|
const MONTH_NAMES = [
|
|
6
|
-
'Giêng',
|
|
7
|
-
'
|
|
6
|
+
'Giêng',
|
|
7
|
+
'Hai',
|
|
8
|
+
'Ba',
|
|
9
|
+
'Tư',
|
|
10
|
+
'Năm',
|
|
11
|
+
'Sáu',
|
|
12
|
+
'Bảy',
|
|
13
|
+
'Tám',
|
|
14
|
+
'Chín',
|
|
15
|
+
'Mười',
|
|
16
|
+
'Một',
|
|
17
|
+
'Chạp'
|
|
8
18
|
];
|
|
9
19
|
/** Tên số đếm truyền thống */
|
|
10
20
|
const DAY_UNITS = [
|
|
11
|
-
'',
|
|
12
|
-
'
|
|
21
|
+
'',
|
|
22
|
+
'Một',
|
|
23
|
+
'Hai',
|
|
24
|
+
'Ba',
|
|
25
|
+
'Bốn',
|
|
26
|
+
'Năm',
|
|
27
|
+
'Sáu',
|
|
28
|
+
'Bảy',
|
|
29
|
+
'Tám',
|
|
30
|
+
'Chín',
|
|
31
|
+
'Mười'
|
|
13
32
|
];
|
|
14
33
|
/**
|
|
15
34
|
* Lấy tên tháng âm lịch dạng chữ truyền thống.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lichta",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Thư viện chuyển đổi Dương lịch ↔ Âm lịch Việt Nam. Vietnamese lunar calendar conversion library with Svelte 5 components.",
|
|
5
|
-
"author": "
|
|
5
|
+
"author": "Zeforc | Stridev",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "vite dev",
|
|
@@ -58,13 +58,24 @@
|
|
|
58
58
|
"@sveltejs/package": "^2.5.8",
|
|
59
59
|
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
60
60
|
"@types/node": "^22",
|
|
61
|
+
"@event-calendar/core": "^5.7.1",
|
|
62
|
+
"@event-calendar/day-grid": "^3.12.0",
|
|
63
|
+
"@fullcalendar/core": "^6.1.20",
|
|
64
|
+
"@fullcalendar/daygrid": "^6.1.20",
|
|
65
|
+
"moment": "^2.30.1",
|
|
61
66
|
"eslint": "^10.4.1",
|
|
62
67
|
"eslint-config-prettier": "^10.1.8",
|
|
63
68
|
"eslint-plugin-svelte": "^3.19.0",
|
|
64
69
|
"globals": "^17.6.0",
|
|
70
|
+
"lichta-event-calendar": "^1.0.0",
|
|
71
|
+
"lichta-full-calendar": "^1.0.0",
|
|
72
|
+
"lichta-react-big-calendar": "^1.0.0",
|
|
65
73
|
"prettier": "^3.8.3",
|
|
66
74
|
"prettier-plugin-svelte": "^4.1.0",
|
|
67
75
|
"publint": "^0.3.21",
|
|
76
|
+
"react": "^19.2.7",
|
|
77
|
+
"react-big-calendar": "^1.20.0",
|
|
78
|
+
"react-dom": "^19.2.7",
|
|
68
79
|
"svelte": "^5.56.1",
|
|
69
80
|
"svelte-check": "^4.6.0",
|
|
70
81
|
"typescript": "^6.0.3",
|
|
@@ -85,10 +96,10 @@
|
|
|
85
96
|
],
|
|
86
97
|
"repository": {
|
|
87
98
|
"type": "git",
|
|
88
|
-
"url": "git+https://github.com/
|
|
99
|
+
"url": "git+https://github.com/zeforc/lichta.git"
|
|
89
100
|
},
|
|
90
101
|
"bugs": {
|
|
91
|
-
"url": "https://github.com/
|
|
102
|
+
"url": "https://github.com/zeforc/lichta/issues"
|
|
92
103
|
},
|
|
93
|
-
"homepage": "https://github.com/
|
|
104
|
+
"homepage": "https://github.com/zeforc/lichta#readme"
|
|
94
105
|
}
|