v1.2.28 支持获取当年第几周;支持2种流派获取起运。
This commit is contained in:
@@ -31,3 +31,9 @@ test('test2', () => {
|
||||
const week = SolarWeek.fromYmd(2021, 5, 4, start);
|
||||
expect(week.getIndex()).toBe(2);
|
||||
});
|
||||
|
||||
test('test3', () => {
|
||||
const start = 0;
|
||||
const week = SolarWeek.fromYmd(2022, 3, 6, start);
|
||||
expect(week.getIndexInYear()).toBe(11);
|
||||
});
|
||||
|
||||
@@ -31,3 +31,30 @@ it('test3', () => {
|
||||
expect(yun.getStartDay()).toBe(0);
|
||||
expect(yun.getStartSolar().toYmd()).toBe('2020-02-06');
|
||||
});
|
||||
|
||||
it('test4', () => {
|
||||
const solar = Solar.fromYmdHms(2022, 3, 9, 20, 51, 0);
|
||||
const lunar = solar.getLunar();
|
||||
const eightChar = lunar.getEightChar();
|
||||
const yun = eightChar.getYun(1);
|
||||
expect(yun.getStartSolar().toYmd()).toBe('2030-12-19');
|
||||
});
|
||||
|
||||
it('test5', () => {
|
||||
const solar = Solar.fromYmdHms(2022, 3, 9, 20, 51, 0);
|
||||
const lunar = solar.getLunar();
|
||||
const eightChar = lunar.getEightChar();
|
||||
const yun = eightChar.getYun(1, 2);
|
||||
expect(yun.getStartYear()).toBe(8);
|
||||
expect(yun.getStartMonth()).toBe(9);
|
||||
expect(yun.getStartDay()).toBe(2);
|
||||
expect(yun.getStartSolar().toYmd()).toBe('2030-12-12');
|
||||
});
|
||||
|
||||
it('test6', () => {
|
||||
const solar = Solar.fromYmdHms(2018, 6, 11, 9, 30, 0);
|
||||
const lunar = solar.getLunar();
|
||||
const eightChar = lunar.getEightChar();
|
||||
const yun = eightChar.getYun(0, 2);
|
||||
expect(yun.getStartSolar().toYmd()).toBe('2020-03-21');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user