Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26557902f6 | ||
|
|
1e7f33e048 | ||
|
|
988d3f60a7 | ||
|
|
9bfb4ea312 | ||
|
|
004899148d | ||
|
|
c142ad7f6c | ||
|
|
8d131aa31a | ||
|
|
34469699a5 | ||
|
|
ca64cf0a73 | ||
|
|
1f2c867028 | ||
|
|
56addd223b |
@@ -415,12 +415,12 @@ test('test022', () => {
|
|||||||
|
|
||||||
test('test023', () => {
|
test('test023', () => {
|
||||||
const lunar = Lunar.fromYmd(2022, 1, 1);
|
const lunar = Lunar.fromYmd(2022, 1, 1);
|
||||||
expect(lunar.getYearNineStar().toString()).toBe('五黄土玉衡');
|
expect(lunar.getYearNineStar().toString()).toBe('六白金开阳');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test024', () => {
|
test('test024', () => {
|
||||||
const lunar = Lunar.fromYmd(2033, 1, 1);
|
const lunar = Lunar.fromYmd(2033, 1, 1);
|
||||||
expect(lunar.getYearNineStar().toString()).toBe('三碧木天玑');
|
expect(lunar.getYearNineStar().toString()).toBe('四绿木天权');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test025', () => {
|
test('test025', () => {
|
||||||
|
|||||||
@@ -22,3 +22,68 @@ test('test4', () => {
|
|||||||
const year = LunarYear.fromYear(2021);
|
const year = LunarYear.fromYear(2021);
|
||||||
expect(year.getGengTian()).toBe('十一牛耕田');
|
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('八运');
|
||||||
|
});
|
||||||
|
|||||||
@@ -19,3 +19,15 @@ test('testFromSunday', () => {
|
|||||||
expect(week.getFirstDay().toString()).toBe('2019-04-28');
|
expect(week.getFirstDay().toString()).toBe('2019-04-28');
|
||||||
expect(week.getFirstDayInMonth().toString()).toBe('2019-05-01');
|
expect(week.getFirstDayInMonth().toString()).toBe('2019-05-01');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('test1', () => {
|
||||||
|
const start = 0;
|
||||||
|
const week = SolarWeek.fromYmd(2022, 5, 1, start);
|
||||||
|
expect(week.getIndex()).toBe(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('test2', () => {
|
||||||
|
const start = 2;
|
||||||
|
const week = SolarWeek.fromYmd(2021, 5, 4, start);
|
||||||
|
expect(week.getIndex()).toBe(2);
|
||||||
|
});
|
||||||
|
|||||||
@@ -53,3 +53,27 @@ test('test9()', () => {
|
|||||||
const lunar = solar.getLunar();
|
const lunar = solar.getLunar();
|
||||||
expect(lunar.getWuHou()).toBe('蚯蚓结');
|
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('小寒 初候');
|
||||||
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lunar-javascript",
|
"name": "lunar-javascript",
|
||||||
"version": "1.2.17",
|
"version": "1.2.26",
|
||||||
"description": "lunar is a calendar library for Solar and Chinese Lunar.",
|
"description": "lunar is a calendar library for Solar and Chinese Lunar.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user