获取当前日期是在当月第几周 @return 周序号,从1开始
()
| 161 | * @return 周序号,从1开始 |
| 162 | */ |
| 163 | public int getIndex() { |
| 164 | int offset = Solar.fromYmd(year, month, 1).getWeek() - start; |
| 165 | if(offset < 0) { |
| 166 | offset += 7; |
| 167 | } |
| 168 | return (int) Math.ceil((day + offset) / 7D); |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * 获取当前日期是在当年第几周 |