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

Compare commits

...

1 Commits

Author SHA1 Message Date
6tail
7a71e07ade v1.3.4 LunarMonth增加序号、干支、财神方位等;完善纪念日。 2023-03-26 21:56:49 +08:00
4 changed files with 281 additions and 8 deletions

View File

@@ -13,3 +13,8 @@ test('test2()', () => {
expect(foto.getGong()).toBe('东');
expect(foto.getShou()).toBe('青龙');
});
test('test3()', () => {
const foto = Foto.fromLunar(Lunar.fromYmd(2021, 3, 16));
expect(foto.getOtherFestivals()).toStrictEqual(['准提菩萨圣诞']);
});

View File

@@ -0,0 +1,37 @@
var {LunarMonth} = require('../lunar');
test('test1', () => {
const month = LunarMonth.fromYm(2023, 1);
expect(month.getIndex()).toBe(1);
expect(month.getGanZhi()).toBe('甲寅');
});
test('test2', () => {
const month = LunarMonth.fromYm(2023, -2);
expect(month.getIndex()).toBe(3);
expect(month.getGanZhi()).toBe('丙辰');
});
test('test3', () => {
const month = LunarMonth.fromYm(2023, 3);
expect(month.getIndex()).toBe(4);
expect(month.getGanZhi()).toBe('丁巳');
});
test('test4', () => {
const month = LunarMonth.fromYm(2024, 1);
expect(month.getIndex()).toBe(1);
expect(month.getGanZhi()).toBe('丙寅');
});
test('test5', () => {
const month = LunarMonth.fromYm(2023, 12);
expect(month.getIndex()).toBe(13);
expect(month.getGanZhi()).toBe('丙寅');
});
test('test6', () => {
const month = LunarMonth.fromYm(2022, 1);
expect(month.getIndex()).toBe(1);
expect(month.getGanZhi()).toBe('壬寅');
});

245
lunar.js

File diff suppressed because one or more lines are too long

View File

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