v1.2.8 新增治水、分饼、耕田、得金、日禄;新增时辰LunarTime;新增获取当天的所有时辰。
This commit is contained in:
@@ -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('子命互禄 辛命进禄');
|
||||
});
|
||||
|
||||
24
__tests__/LunarYear.test.js
Normal file
24
__tests__/LunarYear.test.js
Normal 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('十一牛耕田');
|
||||
});
|
||||
3
index.js
3
index.js
@@ -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,
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user