获取当前日期是在当年第几周 @return 周序号,从1开始
()
| 174 | * @return 周序号,从1开始 |
| 175 | */ |
| 176 | public int getIndexInYear() { |
| 177 | int offset = Solar.fromYmd(year, 1, 1).getWeek() - start; |
| 178 | if(offset < 0) { |
| 179 | offset += 7; |
| 180 | } |
| 181 | return (int) Math.ceil((SolarUtil.getDaysInYear(year, month, day) + offset) / 7D); |
| 182 | } |
| 183 | |
| 184 | /** |
| 185 | * 周推移 |