mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix format
This commit is contained in:
parent
743ff04dcf
commit
2fbb0f469c
@ -116,7 +116,7 @@ public class SolarTerms {
|
||||
*
|
||||
* @param y 公历年(1900-2100)
|
||||
* @param n 二十四节气中的第几个节气(1~24);从n=1(小寒)算起
|
||||
* @return getTerm(1987,3) -》4;意即1987年2月4日立春
|
||||
* @return getTerm(1987, 3) -》4;意即1987年2月4日立春
|
||||
*/
|
||||
public static int getTerm(final int y, final int n) {
|
||||
if (y < 1900 || y > 2100) {
|
||||
@ -143,6 +143,7 @@ public class SolarTerms {
|
||||
|
||||
/**
|
||||
* 根据日期获取节气
|
||||
*
|
||||
* @param date 日期
|
||||
* @return 返回指定日期所处的节气,若不是一个节气则返回空字符串
|
||||
*/
|
||||
@ -154,6 +155,7 @@ public class SolarTerms {
|
||||
|
||||
/**
|
||||
* 根据农历日期获取节气
|
||||
*
|
||||
* @param chineseDate 农历日期
|
||||
* @return 返回指定农历日期所处的节气,若不是一个节气则返回空字符串
|
||||
*/
|
||||
@ -163,6 +165,7 @@ public class SolarTerms {
|
||||
|
||||
/**
|
||||
* 根据日期获取节气
|
||||
*
|
||||
* @param date 日期
|
||||
* @return 返回指定日期所处的节气,若不是一个节气则返回空字符串
|
||||
*/
|
||||
@ -172,6 +175,7 @@ public class SolarTerms {
|
||||
|
||||
/**
|
||||
* 根据年月日获取节气
|
||||
*
|
||||
* @param year 公历年
|
||||
* @param mouth 公历月,从1开始
|
||||
* @param day 公历日,从1开始
|
||||
@ -183,6 +187,7 @@ public class SolarTerms {
|
||||
|
||||
/**
|
||||
* 根据年月日获取节气, 内部方法,不对月和日做有效校验
|
||||
*
|
||||
* @param year 公历年
|
||||
* @param mouth 公历月,从1开始
|
||||
* @param day 公历日,从1开始
|
||||
|
@ -19,7 +19,7 @@ import org.junit.jupiter.api.Test;
|
||||
public class SolarTermsTest {
|
||||
|
||||
@Test
|
||||
public void getTermTest1(){
|
||||
public void getTermTest1() {
|
||||
final int term = SolarTerms.getTerm(1987, 3);
|
||||
Assertions.assertEquals(4, term);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user