Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6581f01956 |
@@ -65,3 +65,13 @@ test('test9', () => {
|
||||
test('test10', () => {
|
||||
expect(Solar.fromYmd(9865, 7, 26).getWeek()).toBe(3);
|
||||
});
|
||||
|
||||
test('test11', () => {
|
||||
expect(Solar.fromYmd(1961, 9, 30).getWeek()).toBe(6);
|
||||
expect(Solar.fromYmdHms(1961, 9, 30, 23, 59, 59).getWeek()).toBe(6);
|
||||
});
|
||||
|
||||
test('test12', () => {
|
||||
expect(Solar.fromYmdHms(2021, 9, 15, 0, 0, 0).getWeek()).toBe(3);
|
||||
expect(Solar.fromYmdHms(2021, 9, 15, 23, 59, 59).getWeek()).toBe(3);
|
||||
});
|
||||
|
||||
2
lunar.js
2
lunar.js
@@ -220,7 +220,7 @@
|
||||
return this._p.second;
|
||||
},
|
||||
getWeek:function(){
|
||||
return (Math.floor(this.getJulianDay()) + 7000002) % 7;
|
||||
return (Math.floor(this.getJulianDay() + 0.5) + 7000001) % 7;
|
||||
},
|
||||
getWeekInChinese:function(){
|
||||
return SolarUtil.WEEK[this.getWeek()];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lunar-javascript",
|
||||
"version": "1.6.6",
|
||||
"version": "1.6.7",
|
||||
"description": "lunar is a calendar library for Solar and Chinese Lunar.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user