1
0
mirror of synced 2026-10-08 16:04:11 +08:00

Compare commits

..

4 Commits

15 changed files with 296 additions and 178 deletions

View File

@@ -16,7 +16,7 @@ lunar是一款无第三方依赖的公历(阳历)、农历(阴历、老黄历)
<dependency>
<groupId>cn.6tail</groupId>
<artifactId>lunar</artifactId>
<version>1.3.7</version>
<version>1.3.11</version>
</dependency>
```

View File

@@ -12,7 +12,7 @@ lunar is a calendar library for Solar and Chinese Lunar.
<dependency>
<groupId>cn.6tail</groupId>
<artifactId>lunar</artifactId>
<version>1.3.7</version>
<version>1.3.11</version>
</dependency>
```

View File

@@ -7,7 +7,7 @@
<groupId>cn.6tail</groupId>
<artifactId>lunar</artifactId>
<packaging>jar</packaging>
<version>1.3.7</version>
<version>1.3.11</version>
<name>${project.groupId}:${project.artifactId}</name>
<url>https://github.com/6tail/lunar-java</url>
<description>a calendar library for Solar and Chinese Lunar</description>

View File

@@ -145,14 +145,14 @@ public class EightChar {
* @return 十神
*/
public String getYearShiShenGan() {
return LunarUtil.SHI_SHEN_GAN.get(getDayGan() + getYearGan());
return LunarUtil.SHI_SHEN.get(getDayGan() + getYearGan());
}
private List<String> getShiShenZhi(String zhi) {
List<String> hideGan = LunarUtil.ZHI_HIDE_GAN.get(zhi);
List<String> l = new ArrayList<String>(hideGan.size());
for (String gan : hideGan) {
l.add(LunarUtil.SHI_SHEN_ZHI.get(getDayGan() + gan));
l.add(LunarUtil.SHI_SHEN.get(getDayGan() + gan));
}
return l;
}
@@ -264,7 +264,7 @@ public class EightChar {
* @return 十神
*/
public String getMonthShiShenGan() {
return LunarUtil.SHI_SHEN_GAN.get(getDayGan() + getMonthGan());
return LunarUtil.SHI_SHEN.get(getDayGan() + getMonthGan());
}
/**
@@ -426,7 +426,7 @@ public class EightChar {
* @return 十神
*/
public String getTimeShiShenGan() {
return LunarUtil.SHI_SHEN_GAN.get(getDayGan() + getTimeGan());
return LunarUtil.SHI_SHEN.get(getDayGan() + getTimeGan());
}
/**
@@ -501,27 +501,27 @@ public class EightChar {
public String getMingGong() {
int monthZhiIndex = 0;
int timeZhiIndex = 0;
String monthZhi = getMonthZhi();
String timeZhi = getTimeZhi();
for (int i = 0, j = MONTH_ZHI.length; i < j; i++) {
String zhi = MONTH_ZHI[i];
if (lunar.getMonthZhiExact().equals(zhi)) {
if (monthZhi.equals(MONTH_ZHI[i])) {
monthZhiIndex = i;
break;
}
if (lunar.getTimeZhi().equals(zhi)) {
}
for (int i = 0, j = MONTH_ZHI.length; i < j; i++) {
if (timeZhi.equals(MONTH_ZHI[i])) {
timeZhiIndex = i;
break;
}
}
int zhiIndex = 26 - (monthZhiIndex + timeZhiIndex);
if (zhiIndex > 12) {
zhiIndex -= 12;
int offset = monthZhiIndex + timeZhiIndex;
offset = (offset >= 14 ? 26 : 14) - offset;
int ganIndex = (lunar.getYearGanIndexExact() + 1) * 2 + offset;
while (ganIndex > 10) {
ganIndex -= 10;
}
int jiaZiIndex = LunarUtil.getJiaZiIndex(lunar.getMonthInGanZhiExact()) - (monthZhiIndex - zhiIndex);
if (jiaZiIndex >= 60) {
jiaZiIndex -= 60;
}
if (jiaZiIndex < 0) {
jiaZiIndex += 60;
}
return LunarUtil.JIA_ZI[jiaZiIndex];
return LunarUtil.GAN[ganIndex] + MONTH_ZHI[offset];
}
/**
@@ -541,27 +541,29 @@ public class EightChar {
public String getShenGong() {
int monthZhiIndex = 0;
int timeZhiIndex = 0;
String monthZhi = getMonthZhi();
String timeZhi = getTimeZhi();
for (int i = 0, j = MONTH_ZHI.length; i < j; i++) {
String zhi = MONTH_ZHI[i];
if (lunar.getMonthZhiExact().equals(zhi)) {
if (monthZhi.equals(MONTH_ZHI[i])) {
monthZhiIndex = i;
break;
}
if (lunar.getTimeZhi().equals(zhi)) {
}
for (int i = 0, j = MONTH_ZHI.length; i < j; i++) {
if (timeZhi.equals(LunarUtil.ZHI[i])) {
timeZhiIndex = i;
break;
}
}
int zhiIndex = 2 + monthZhiIndex + timeZhiIndex;
if (zhiIndex > 12) {
zhiIndex -= 12;
int offset = monthZhiIndex + timeZhiIndex;
while (offset > 12) {
offset -= 12;
}
int jiaZiIndex = LunarUtil.getJiaZiIndex(lunar.getMonthInGanZhiExact()) - (monthZhiIndex - zhiIndex);
if (jiaZiIndex >= 60) {
jiaZiIndex -= 60;
int ganIndex = (lunar.getYearGanIndexExact() + 1) * 2 + (offset % 12);
while (ganIndex > 10) {
ganIndex -= 10;
}
if (jiaZiIndex < 0) {
jiaZiIndex += 60;
}
return LunarUtil.JIA_ZI[jiaZiIndex];
return LunarUtil.GAN[ganIndex] + MONTH_ZHI[offset];
}
/**

View File

@@ -2944,11 +2944,7 @@ public class Lunar {
days = current.subtract(start);
Solar liQiuSolar = Solar.fromYmd(liQiu.getYear(), liQiu.getMonth(), liQiu.getDay());
// 末伏
if (!liQiuSolar.isAfter(start)) {
if (days < 10) {
return new Fu("末伏", days + 1);
}
} else {
if (liQiuSolar.isAfter(start)) {
// 中伏
if (days < 10) {
return new Fu("中伏", days + 11);
@@ -2956,9 +2952,9 @@ public class Lunar {
// 末伏第1天
start = start.next(10);
days = current.subtract(start);
if (days < 10) {
return new Fu("末伏", days + 1);
}
}
if (days < 10) {
return new Fu("末伏", days + 1);
}
return null;
}

View File

@@ -298,7 +298,7 @@ public class Solar {
List<Solar> l = new ArrayList<Solar>();
List<Integer> years = new ArrayList<Integer>();
Solar today = fromDate(new Date());
int offsetYear = LunarUtil.getJiaZiIndex(today.getLunar().getYearInGanZhiExact())-LunarUtil.getJiaZiIndex(yearGanZhi);
int offsetYear = (today.getYear() - 4) % 60 - LunarUtil.getJiaZiIndex(yearGanZhi);
if(offsetYear < 0){
offsetYear += 60;
}
@@ -358,26 +358,7 @@ public class Solar {
* @return 0123456
*/
public int getWeek() {
Solar start = fromYmd(1582, 10, 15);
int y = year;
int m = month;
int d = day;
Solar current = fromYmd(y, m, d);
// 蔡勒公式
if (m < 3) {
m += 12;
y--;
}
int c = y / 100;
y = y - c * 100;
int x = y + y / 4 + c / 4 - 2 * c;
int w;
if (current.isBefore(start)) {
w = (x + 13 * (m + 1) / 5 + d + 2) % 7;
} else {
w = (x + 26 * (m + 1) / 10 + d - 1) % 7;
}
return (w + 7) % 7;
return ((int)(getJulianDay() + 0.5) + 7000001) % 7;
}
/**

File diff suppressed because one or more lines are too long

View File

@@ -42,7 +42,14 @@ public class LunarUtil{
/** 地支方位 */
public static final String[] POSITION_ZHI = {"坎","中","震","震","中","离","离","中","兑","兑","中","坎"};
/** 逐日胎神方位 */
public static final String[] POSITION_TAI_DAY = {"占门碓 外东南","碓磨厕 外东南","厨灶炉 外正南","仓库门 外正南","房床栖 外正南","占门床 外正南","占碓磨 外正南","厕灶厨 外西南","仓库炉 外西南","房床门 外西南","门碓栖 外西南","碓磨床 外西南","厨灶碓 外西南","仓库厕 外正西","房床炉 外正西","占大门 外正西","碓磨栖 外正西","厨房床 外正西","仓库碓 外西北","房床厕 外西北","占门炉 外西北","门碓磨 外西北","厨灶栖 外西北","仓库床 外西北","房床碓 外正北","占门厕 外正北","碓磨炉 外正北","厨灶门 外正北","仓库栖 外正北","占房床 房内北","占门碓 房内北","碓磨厕 房内北","厨灶炉 房内北","门仓库 房内北","床房栖 房内中","占门床 房内中","占碓磨 房内南","厨磨厕 房内南","仓库炉 房内南","房床门 房内西","门碓栖 房内东","碓磨床 房内东","厨灶碓 房内东","仓库厕 房内东","房床炉 房内中","占大门 外东北","碓磨栖 外东北","厨灶床 外东北","仓库碓 外东北","房床厕 外东北","占门炉 外东北","门碓磨 外正东","厨灶栖 外正东","仓库床 外正东","房床碓 外正东","占门厕 外正东","碓磨炉 外东南","厨灶门 外东南","仓库栖 外东南","占房床 外东南"};
public static final String[] POSITION_TAI_DAY = {
"占门碓 外东南","碓磨厕 外东南","厨灶炉 外正南","仓库门 外正南","房床栖 外正南","占门床 外正南","占碓磨 外正南","厨灶厕 外西南","仓库炉 外西南","房床门 外西南",
"占门栖 外西南","碓磨床 外西南","厨灶碓 外西南","仓库厕 外正西","房床炉 外正西","占大门 外正西","碓磨栖 外正西","厨灶床 外正西","仓库碓 外西北","房床厕 外西北",
"占门炉 外西北","碓磨门 外西北","厨灶栖 外西北","仓库床 外西北","房床碓 外正北","占门厕 外正北","碓磨炉 外正北","厨灶门 外正北","仓库栖 外正北","占房床 房内北",
"占门碓 房内北","碓磨厕 房内北","厨灶炉 房内北","仓库门 房内北","房床栖 房内中","占门床 房内中","占碓磨 房内南","厨灶厕 房内南","仓库炉 房内南","房床门 房内西",
"占门栖 房内东","碓磨床 房内东","厨灶碓 房内东","仓库厕 房内东","房床炉 房内中","占大门 外东北","碓磨栖 外东北","厨灶床 外东北","仓库碓 外东北","房床厕 外东北",
"占门炉 外东北","碓磨门 外正东","厨灶栖 外正东","仓库床 外正东","房床碓 外正东","占门厕 外正东","碓磨炉 外东南","厨灶门 外东南","仓库栖 外东南","占房床 外东南"
};
/** 逐月胎神方位 */
public static final String[] POSITION_TAI_MONTH = {"占房床","占户窗","占门堂","占厨灶","占房床","占床仓","占碓磨","占厕户","占门房","占房床","占灶炉","占房床"};
/** 地支 */
@@ -306,7 +313,7 @@ public class LunarUtil{
put("轸","吉");
}
};
/** 星宿对应吉凶 */
/** 星宿歌诀 */
public static final Map<String,String> XIU_SONG = new HashMap<String,String>(){
private static final long serialVersionUID = -1;
{
@@ -598,8 +605,8 @@ public class LunarUtil{
}
};
/** 天干十神,日主+天干为键 */
public static final Map<String,String> SHI_SHEN_GAN = new HashMap<String,String>() {
/** 十神,日主+天干为键 */
public static final Map<String,String> SHI_SHEN = new HashMap<String,String>() {
private static final long serialVersionUID = -1;
{
put("甲甲","比肩");
@@ -705,113 +712,6 @@ public class LunarUtil{
}
};
/** 地支十神,日主+地支藏干主气为键 */
public static final Map<String,String> SHI_SHEN_ZHI = new HashMap<String,String>() {
private static final long serialVersionUID = -1;
{
put("甲癸","正印");
put("甲己","正财");
put("甲辛","正官");
put("甲丙","食神");
put("甲甲","比肩");
put("甲戊","偏财");
put("甲乙","劫财");
put("甲庚","七杀");
put("甲丁","伤官");
put("甲壬","偏印");
put("乙癸","偏印");
put("乙己","偏财");
put("乙辛","七杀");
put("乙丙","伤官");
put("乙甲","劫财");
put("乙戊","正财");
put("乙乙","比肩");
put("乙庚","正官");
put("乙丁","食神");
put("乙壬","正印");
put("丙癸","正官");
put("丙己","伤官");
put("丙辛","正财");
put("丙丙","比肩");
put("丙甲","偏印");
put("丙戊","食神");
put("丙乙","正印");
put("丙庚","偏财");
put("丙丁","劫财");
put("丙壬","七杀");
put("丁癸","七杀");
put("丁己","食神");
put("丁辛","偏财");
put("丁丙","劫财");
put("丁甲","正印");
put("丁戊","伤官");
put("丁乙","偏印");
put("丁庚","正财");
put("丁丁","比肩");
put("丁壬","正官");
put("戊癸","正财");
put("戊己","劫财");
put("戊辛","伤官");
put("戊丙","偏印");
put("戊甲","七杀");
put("戊戊","比肩");
put("戊乙","正官");
put("戊庚","食神");
put("戊丁","正印");
put("戊壬","偏财");
put("己癸","偏财");
put("己己","比肩");
put("己辛","食神");
put("己丙","正印");
put("己甲","正官");
put("己戊","劫财");
put("己乙","七杀");
put("己庚","伤官");
put("己丁","偏印");
put("己壬","正财");
put("庚癸","伤官");
put("庚己","正印");
put("庚辛","劫财");
put("庚丙","七杀");
put("庚甲","偏财");
put("庚戊","偏印");
put("庚乙","正财");
put("庚庚","比肩");
put("庚丁","正官");
put("庚壬","食神");
put("辛癸","食神");
put("辛己","偏印");
put("辛辛","比肩");
put("辛丙","正官");
put("辛甲","正财");
put("辛戊","正印");
put("辛乙","偏财");
put("辛庚","劫财");
put("辛丁","七杀");
put("辛壬","伤官");
put("壬癸","劫财");
put("壬己","正官");
put("壬辛","正印");
put("壬丙","偏财");
put("壬甲","食神");
put("壬戊","七杀");
put("壬乙","伤官");
put("壬庚","偏印");
put("壬丁","正财");
put("壬壬","比肩");
put("癸癸","比肩");
put("癸己","七杀");
put("癸辛","偏印");
put("癸丙","正财");
put("癸甲","伤官");
put("癸戊","正官");
put("癸乙","食神");
put("癸庚","正印");
put("癸丁","偏财");
put("癸壬","劫财");
}
};
/** 地支藏干表,分别为主气、余气、杂气 */
public static final Map<String,List<String>> ZHI_HIDE_GAN = new HashMap<String,List<String>>() {
private static final long serialVersionUID = -1;

View File

@@ -77,7 +77,7 @@ public class BaZiTestNew {
public void test7() {
Solar solar = new Solar(2020, 5, 26, 23, 43, 0);
Lunar lunar = solar.getLunar();
//庚子, 辛巳, 庚午, 丙子]
// [庚子, 辛巳, 庚午, 丙子]
System.out.println(lunar.getEightChar());
}

View File

@@ -1,8 +1,12 @@
package sample;
import com.nlf.calendar.Holiday;
import com.nlf.calendar.Solar;
import com.nlf.calendar.util.HolidayUtil;
import org.junit.Test;
import java.util.List;
public class HolidayTest {
@Test
@@ -20,4 +24,31 @@ public class HolidayTest {
System.out.println(HolidayUtil.getHolidaysByTarget("20200501"));
System.out.println(HolidayUtil.getHolidaysByTarget(2011,1,1));
}
@Test
public void test1(){
StringBuilder s = new StringBuilder();
for(int i = 2001; i <= 2024; i++) {
List<Holiday> l = HolidayUtil.getHolidays(i);
for (Holiday d : l) {
int index = -1;
for (int x = 0;x <HolidayUtil.NAMES.length;x++) {
if (HolidayUtil.NAMES[x].equals(d.getName())) {
index = x;
break;
}
}
if (index == -1) {
throw new IllegalArgumentException(d.getName());
}
String day = d.getDay();
String target = d.getTarget();
Solar solar = Solar.fromYmd(Integer.parseInt(day.substring(0,4)), Integer.parseInt(day.substring(5,7)), Integer.parseInt(day.substring(8)));
Solar targetSolar = Solar.fromYmd(Integer.parseInt(target.substring(0,4)), Integer.parseInt(target.substring(5,7)), Integer.parseInt(target.substring(8)));
int diff = targetSolar.subtract(solar);
s.append(String.format("%s%d%d%s%02d", d.getDay().replace("-",""), d.isWork() ? 0 : 1, index, diff < 0 ? "-" : "+", Math.abs(diff)));
}
}
System.out.println(s);
}
}

View File

@@ -234,7 +234,7 @@ public class BaZiTest {
@Test
public void testShenGong1() {
Lunar lunar = new Solar(1994, 12, 6, 2, 0, 0).getLunar();
Assert.assertEquals("身宫", "丁丑", lunar.getEightChar().getShenGong());
Assert.assertEquals("身宫", "乙丑", lunar.getEightChar().getShenGong());
}
@Test
@@ -406,4 +406,91 @@ public class BaZiTest {
expected.add("1959-12-17 16:00:00");
Assert.assertEquals(expected, actual);
}
@Test
public void test17() {
Solar solar = new Solar(1986, 5, 29, 13, 37, 0);
Lunar lunar = solar.getLunar();
EightChar eightChar = lunar.getEightChar();
Assert.assertEquals("己丑", eightChar.getShenGong());
}
@Test
public void test18() {
Solar solar = new Solar(2023, 10, 8, 18, 37, 0);
Lunar lunar = solar.getLunar();
EightChar eightChar = lunar.getEightChar();
Assert.assertEquals("己未", eightChar.getShenGong());
}
@Test
public void test19() {
List<Solar> l = Solar.fromBaZi("丁丑","癸卯","癸丑","辛酉");
List<String> actual = new ArrayList<String>();
for (Solar solar : l) {
actual.add(solar.toYmdHms());
}
List<String> expected = new ArrayList<String>();
expected.add("1997-03-12 18:00:00");
expected.add("1937-03-27 18:00:00");
Assert.assertEquals(expected, actual);
}
@Test
public void test20() {
List<Solar> l = Solar.fromBaZi("乙未","己卯","丁丑","甲辰");
List<String> actual = new ArrayList<String>();
for (Solar solar : l) {
actual.add(solar.toYmdHms());
}
List<String> expected = new ArrayList<String>();
expected.add("1955-03-17 08:00:00");
Assert.assertEquals(expected, actual);
}
@Test
public void test21() {
Lunar lunar = Solar.fromYmdHms(2024, 1, 29, 9, 30, 0).getLunar();
EightChar eightChar = lunar.getEightChar();
Assert.assertEquals("命宫", "癸亥", eightChar.getMingGong());
Assert.assertEquals("身宫", "己未", eightChar.getShenGong());
}
@Test
public void test22() {
Assert.assertEquals("身宫", "丙寅", Solar.fromYmdHms(1990, 1, 27, 0, 0, 0).getLunar().getEightChar().getShenGong());
}
@Test
public void test23() {
Assert.assertEquals("甲戌", Solar.fromYmdHms(2019, 3, 7, 8, 0, 0).getLunar().getEightChar().getMingGong());
}
@Test
public void test24() {
Assert.assertEquals("丁丑", Solar.fromYmdHms(2019, 3, 27, 2, 0, 0).getLunar().getEightChar().getMingGong());
}
@Test
public void test25() {
Assert.assertEquals("丙寅", Lunar.fromYmdHms(1994, 5, 20, 18, 0 ,0).getEightChar().getMingGong());
}
@Test
public void test26() {
Lunar lunar = Solar.fromYmdHms(1986, 2, 16, 8, 0, 0).getLunar();
EightChar eightChar = lunar.getEightChar();
Assert.assertEquals("命宫", "己亥", eightChar.getMingGong());
Assert.assertEquals("身宫", "乙未", eightChar.getShenGong());
}
@Test
public void test27() {
Lunar lunar = Solar.fromYmdHms(1972, 11, 27, 10, 0, 0).getLunar();
EightChar eightChar = lunar.getEightChar();
Assert.assertEquals("身宫", "乙巳", eightChar.getShenGong());
}
}

View File

@@ -53,4 +53,10 @@ public class LunarMonthTest {
Assert.assertEquals("壬寅", month.getGanZhi());
}
@Test
public void test6(){
LunarMonth month = LunarMonth.fromYm(2023, 9);
Assert.assertEquals("癸亥", month.getGanZhi());
}
}

View File

@@ -377,7 +377,7 @@ public class LunarTest {
public void test52() {
Solar solar = Solar.fromYmd(2011, 11, 12);
Lunar lunar = solar.getLunar();
Assert.assertEquals("厕灶厨 外西南", lunar.getDayPositionTai());
Assert.assertEquals("厨灶厕 外西南", lunar.getDayPositionTai());
}
@Test
@@ -645,4 +645,10 @@ public class LunarTest {
Assert.assertEquals("九一七年冬月十六", lunar.toString());
}
@Test
public void test95() {
Lunar lunar = Solar.fromYmd(2023, 10, 30).getLunar();
Assert.assertEquals("闭", lunar.getZhiXing());
}
}

View File

@@ -1,6 +1,8 @@
package test;
import com.nlf.calendar.Lunar;
import com.nlf.calendar.LunarMonth;
import com.nlf.calendar.LunarYear;
import com.nlf.calendar.Solar;
import org.junit.Assert;
import org.junit.Test;
@@ -10,17 +12,69 @@ public class NineStarTest {
public void test1() {
Lunar lunar = Solar.fromYmd(1985, 2, 19).getLunar();
Assert.assertEquals("六", lunar.getYearNineStar().getNumber());
Assert.assertEquals("五黄土玉衡", lunar.getDayNineStar().toString());
}
@Test
public void test2() {
Lunar lunar = Lunar.fromYmd(2022, 1, 1);
Assert.assertEquals("六白金开阳", lunar.getYearNineStar().toString());
Assert.assertEquals("四绿木天权", lunar.getDayNineStar().toString());
}
@Test
public void test3() {
Lunar lunar = Lunar.fromYmd(2033, 1, 1);
Assert.assertEquals("四绿木天权", lunar.getYearNineStar().toString());
Assert.assertEquals("一白水天枢", lunar.getDayNineStar().toString());
}
@Test
public void test4() {
LunarYear y = LunarYear.fromYear(1985);
Assert.assertEquals("六白金开阳", y.getNineStar().toString());
}
@Test
public void test5() {
LunarYear y = LunarYear.fromYear(2022);
Assert.assertEquals("五黄土玉衡", y.getNineStar().toString());
}
@Test
public void test6() {
LunarYear y = LunarYear.fromYear(2033);
Assert.assertEquals("三碧木天玑", y.getNineStar().toString());
}
@Test
public void test7() {
LunarMonth m = LunarMonth.fromYm(1985, 2);
Assert.assertEquals("四绿木天权", m.getNineStar().toString());
}
@Test
public void test8() {
LunarMonth m = LunarMonth.fromYm(2022, 1);
Assert.assertEquals("二黒土天璇", m.getNineStar().toString());
}
@Test
public void test9() {
LunarMonth m = LunarMonth.fromYm(2033, 1);
Assert.assertEquals("五黄土玉衡", m.getNineStar().toString());
}
@Test
public void test10() {
Lunar d = Lunar.fromYmdHms(2033, 1, 1, 12, 0,0);
Assert.assertEquals("七赤金摇光", d.getTimeNineStar().toString());
}
@Test
public void test11() {
Lunar d = Lunar.fromYmdHms(2011, 5, 3, 23, 0,0);
Assert.assertEquals("七赤金摇光", d.getTimeNineStar().toString());
}
}

View File

@@ -54,4 +54,59 @@ public class WeekTest {
Solar solar = Solar.fromYmd(1582, 10, 15);
Assert.assertEquals(5, solar.getWeek());
}
@Test
public void test3(){
Solar solar = Solar.fromYmd(1129, 11, 17);
Assert.assertEquals(0, solar.getWeek());
}
@Test
public void test4(){
Solar solar = Solar.fromYmd(1129, 11, 1);
Assert.assertEquals(5, solar.getWeek());
}
@Test
public void test5(){
Solar solar = Solar.fromYmd(8, 11, 1);
Assert.assertEquals(4, solar.getWeek());
}
@Test
public void test6(){
Solar solar = Solar.fromYmd(1582, 9, 30);
Assert.assertEquals(0, solar.getWeek());
}
@Test
public void test7(){
Solar solar = Solar.fromYmd(1582, 1, 1);
Assert.assertEquals(1, solar.getWeek());
}
@Test
public void test8(){
Solar solar = Solar.fromYmd(1500, 2, 29);
Assert.assertEquals(6, solar.getWeek());
}
@Test
public void test9(){
Solar solar = Solar.fromYmd(9865, 7, 26);
Assert.assertEquals(3, solar.getWeek());
}
@Test
public void test10(){
Assert.assertEquals(6, Solar.fromYmd(1961, 9, 30).getWeek());
Assert.assertEquals(6, Solar.fromYmdHms(1961, 9, 30, 23, 59, 59).getWeek());
Assert.assertEquals(6, Solar.fromYmdHms(1961, 9, 30, 20, 0, 0).getWeek());
}
@Test
public void test11(){
Assert.assertEquals(3, Solar.fromYmdHms(2021, 9, 15, 20, 0, 0).getWeek());
}
}