1
0
mirror of synced 2026-02-09 22:48:00 +08:00

add static fromXX methods

This commit is contained in:
6tail
2018-06-24 17:48:32 +08:00
parent 7741dfe979
commit c196e58ec8
7 changed files with 217 additions and 5 deletions

View File

@@ -54,6 +54,37 @@ public class SolarMonth{
this.month = month;
}
/**
* 通过指定日期获取阳历月
*
* @param date 日期
* @return 阳历月
*/
public static SolarMonth fromDate(Date date){
return new SolarMonth(date);
}
/**
* 通过指定日历获取阳历月
*
* @param calendar 日历
* @return 阳历月
*/
public static SolarMonth fromCalendar(Calendar calendar){
return new SolarMonth(calendar);
}
/**
* 通过指定年月获取阳历月
*
* @param year 年
* @param month 月
* @return 阳历月
*/
public static SolarMonth fromYm(int year,int month){
return new SolarMonth(year,month);
}
/**
* 获取年
*