Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac57a9bae0 | ||
|
|
3f2f9d702c | ||
|
|
c0bd1d5565 | ||
|
|
263f280395 | ||
|
|
5d18af8619 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
*.iml
|
*.iml
|
||||||
node_modules/
|
node_modules/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
.DS_Store
|
||||||
|
|||||||
@@ -59,4 +59,4 @@ lunar是一款无第三方依赖的公历(阳历)、农历(阴历、老黄历)
|
|||||||
|
|
||||||
## 文档
|
## 文档
|
||||||
|
|
||||||
请移步至 [http://6tail.cn/calendar/api.html](http://6tail.cn/calendar/api.html "http://6tail.cn/calendar/api.html")
|
请移步至 [https://6tail.cn/calendar/api.html](https://6tail.cn/calendar/api.html "https://6tail.cn/calendar/api.html")
|
||||||
|
|||||||
@@ -59,4 +59,4 @@ Output:
|
|||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Please visit [http://6tail.cn/calendar/api.html](http://6tail.cn/calendar/api.html "http://6tail.cn/calendar/api.html")
|
Please visit [https://6tail.cn/calendar/api.html](https://6tail.cn/calendar/api.html "https://6tail.cn/calendar/api.html")
|
||||||
|
|||||||
@@ -413,16 +413,6 @@ test('test022', () => {
|
|||||||
expect(lunar.getSolar().toString()).toBe('2033-12-22');
|
expect(lunar.getSolar().toString()).toBe('2033-12-22');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test023', () => {
|
|
||||||
const lunar = Lunar.fromYmd(2022, 1, 1);
|
|
||||||
expect(lunar.getYearNineStar().toString()).toBe('六白金开阳');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('test024', () => {
|
|
||||||
const lunar = Lunar.fromYmd(2033, 1, 1);
|
|
||||||
expect(lunar.getYearNineStar().toString()).toBe('四绿木天权');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('test025', () => {
|
test('test025', () => {
|
||||||
const solar = Solar.fromYmdHms(2021, 6, 7, 21, 18, 0);
|
const solar = Solar.fromYmdHms(2021, 6, 7, 21, 18, 0);
|
||||||
expect(solar.getLunar().toString()).toBe('二〇二一年四月廿七');
|
expect(solar.getLunar().toString()).toBe('二〇二一年四月廿七');
|
||||||
|
|||||||
16
__tests__/NineStar.test.js
Normal file
16
__tests__/NineStar.test.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
const {Solar, Lunar} = require('../lunar');
|
||||||
|
|
||||||
|
test('test1', () => {
|
||||||
|
const lunar = Solar.fromYmd(1985, 2, 19).getLunar();
|
||||||
|
expect(lunar.getYearNineStar().getNumber()).toBe('六');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('test023', () => {
|
||||||
|
const lunar = Lunar.fromYmd(2022, 1, 1);
|
||||||
|
expect(lunar.getYearNineStar().toString()).toBe('六白金开阳');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('test024', () => {
|
||||||
|
const lunar = Lunar.fromYmd(2033, 1, 1);
|
||||||
|
expect(lunar.getYearNineStar().toString()).toBe('四绿木天权');
|
||||||
|
});
|
||||||
@@ -83,3 +83,15 @@ test('test14', () => {
|
|||||||
const lunar = solar.getLunar();
|
const lunar = solar.getLunar();
|
||||||
expect(lunar.getHou()).toBe('立夏 三候');
|
expect(lunar.getHou()).toBe('立夏 三候');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('test15', () => {
|
||||||
|
const solar = Solar.fromYmd(2022, 8, 22);
|
||||||
|
const lunar = solar.getLunar();
|
||||||
|
expect(lunar.getWuHou()).toBe('寒蝉鸣');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('test16', () => {
|
||||||
|
const solar = Solar.fromYmd(2022, 8, 23);
|
||||||
|
const lunar = solar.getLunar();
|
||||||
|
expect(lunar.getWuHou()).toBe('鹰乃祭鸟');
|
||||||
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lunar-javascript",
|
"name": "lunar-javascript",
|
||||||
"version": "1.2.34",
|
"version": "1.2.37",
|
||||||
"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