MCPcopy Create free account
hub / github.com/6tail/lunar-java / getWeeks

Method getWeeks

src/main/java/com/nlf/calendar/SolarMonth.java:132–144  ·  view source on GitHub ↗

获取本月的阳历周列表 @param start 星期几作为一周的开始,1234560分别代表星期一至星期天 @return 周列表

(int start)

Source from the content-addressed store, hash-verified

130 * @return 周列表
131 */
132 public List<SolarWeek> getWeeks(int start) {
133 List<SolarWeek> l = new ArrayList<SolarWeek>();
134 SolarWeek week = SolarWeek.fromYmd(year, month, 1, start);
135 while (true) {
136 l.add(week);
137 week = week.next(1, false);
138 Solar firstDay = week.getFirstDay();
139 if (firstDay.getYear() > year || firstDay.getMonth() > month) {
140 break;
141 }
142 }
143 return l;
144 }
145
146 /**
147 * 获取往后推几个月的阳历月,如果要往前推,则月数用负数

Callers

nothing calls this directly

Calls 5

fromYmdMethod · 0.95
nextMethod · 0.95
getFirstDayMethod · 0.95
getYearMethod · 0.95
getMonthMethod · 0.95

Tested by

no test coverage detected