1
0
mirror of synced 2026-04-19 06:48:41 +08:00

v1.2.8 新增治水、分饼、耕田、得金、日禄;新增时辰LunarTime;新增获取当天的所有时辰。

This commit is contained in:
6tail
2021-10-13 22:19:45 +08:00
parent 7d305771a9
commit 632d218e09
5 changed files with 187 additions and 5 deletions

View File

@@ -540,3 +540,8 @@ test('test046', () => {
const solar = Solar.fromYmdHms(2000, 1, 1, 16, 0, 0);
expect(solar.getLunar().getHour()).toBe(16);
});
test('test047', () => {
const lunar = Solar.fromYmd(2017, 2, 15).getLunar();
expect(lunar.getDayLu()).toBe('子命互禄 辛命进禄');
});

View File

@@ -0,0 +1,24 @@
var {LunarYear} = require('../lunar');
test('test1', () => {
const year = LunarYear.fromYear(2017);
expect(year.getZhiShui()).toBe('二龙治水');
expect(year.getFenBing()).toBe('二人分饼');
});
test('test2', () => {
const year = LunarYear.fromYear(2018);
expect(year.getZhiShui()).toBe('二龙治水');
expect(year.getFenBing()).toBe('八人分饼');
});
test('test3', () => {
const year = LunarYear.fromYear(5);
expect(year.getZhiShui()).toBe('三龙治水');
expect(year.getFenBing()).toBe('一人分饼');
});
test('test4', () => {
const year = LunarYear.fromYear(2021);
expect(year.getGengTian()).toBe('十一牛耕田');
});

View File

@@ -1,4 +1,4 @@
const {Solar, Lunar, NineStar, EightChar, SolarWeek, SolarMonth, SolarSeason, SolarHalfYear, SolarYear, LunarMonth, LunarYear, ShouXingUtil, SolarUtil, LunarUtil, HolidayUtil} = require('./lunar.js')
const {Solar, Lunar, NineStar, EightChar, SolarWeek, SolarMonth, SolarSeason, SolarHalfYear, SolarYear, LunarMonth, LunarYear, LunarTime, ShouXingUtil, SolarUtil, LunarUtil, HolidayUtil} = require('./lunar.js')
module.exports = {
Solar: Solar,
@@ -12,6 +12,7 @@ module.exports = {
SolarYear: SolarYear,
LunarMonth: LunarMonth,
LunarYear: LunarYear,
LunarTime: LunarTime,
ShouXingUtil: ShouXingUtil,
SolarUtil: SolarUtil,
LunarUtil: LunarUtil,

158
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.7",
"version": "1.2.8",
"description": "lunar is a calendar library for Solar and Chinese Lunar.",
"main": "index.js",
"scripts": {