1
0
mirror of synced 2026-04-16 21:38:40 +08:00

Compare commits

..

2 Commits

4 changed files with 269 additions and 95 deletions

View File

@@ -22,3 +22,68 @@ test('test4', () => {
const year = LunarYear.fromYear(2021);
expect(year.getGengTian()).toBe('十一牛耕田');
});
test('test5', () => {
const year = LunarYear.fromYear(1864);
expect(year.getYuan()).toBe('上元');
});
test('test6', () => {
const year = LunarYear.fromYear(1923);
expect(year.getYuan()).toBe('上元');
});
test('test7', () => {
const year = LunarYear.fromYear(1924);
expect(year.getYuan()).toBe('中元');
});
test('test8', () => {
const year = LunarYear.fromYear(1983);
expect(year.getYuan()).toBe('中元');
});
test('test9', () => {
const year = LunarYear.fromYear(1984);
expect(year.getYuan()).toBe('下元');
});
test('test10', () => {
const year = LunarYear.fromYear(2043);
expect(year.getYuan()).toBe('下元');
});
test('test11', () => {
const year = LunarYear.fromYear(1864);
expect(year.getYun()).toBe('一运');
});
test('test12', () => {
const year = LunarYear.fromYear(1883);
expect(year.getYun()).toBe('一运');
});
test('test13', () => {
const year = LunarYear.fromYear(1884);
expect(year.getYun()).toBe('二运');
});
test('test14', () => {
const year = LunarYear.fromYear(1903);
expect(year.getYun()).toBe('二运');
});
test('test15', () => {
const year = LunarYear.fromYear(1904);
expect(year.getYun()).toBe('三运');
});
test('test16', () => {
const year = LunarYear.fromYear(1923);
expect(year.getYun()).toBe('三运');
});
test('test17', () => {
const year = LunarYear.fromYear(2004);
expect(year.getYun()).toBe('八运');
});

View File

@@ -53,3 +53,27 @@ test('test9()', () => {
const lunar = solar.getLunar();
expect(lunar.getWuHou()).toBe('蚯蚓结');
});
test('test10', () => {
const solar = Solar.fromYmd(2021,12,21);
const lunar = solar.getLunar();
expect(lunar.getHou()).toBe('冬至 初候');
});
test('test11', () => {
const solar = Solar.fromYmd(2021,12,26);
const lunar = solar.getLunar();
expect(lunar.getHou()).toBe('冬至 二候');
});
test('test12', () => {
const solar = Solar.fromYmd(2021,12,31);
const lunar = solar.getLunar();
expect(lunar.getHou()).toBe('冬至 三候');
});
test('test13', () => {
const solar = Solar.fromYmd(2022,1,5);
const lunar = solar.getLunar();
expect(lunar.getHou()).toBe('小寒 初候');
});

273
lunar.js

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"name": "lunar-javascript",
"version": "1.2.17",
"version": "1.2.19",
"description": "lunar is a calendar library for Solar and Chinese Lunar.",
"main": "index.js",
"scripts": {