(T context)
| 485 | } |
| 486 | |
| 487 | @Override |
| 488 | public int getInt(T context) { |
| 489 | |
| 490 | PlainDate date = context.get(CALENDAR_DATE); |
| 491 | int year = date.getYear(); |
| 492 | int dayOfYear = date.getDayOfYear(); |
| 493 | int wCurrent = getFirstCalendarWeekAsDayOfYear(date, 0); |
| 494 | |
| 495 | if (wCurrent <= dayOfYear) { |
| 496 | if ( |
| 497 | (((dayOfYear - wCurrent) / 7) + 1 >= 53) |
| 498 | && (getFirstCalendarWeekAsDayOfYear(date, 1) + getLengthOfYear(date, 0) <= dayOfYear) |
| 499 | ) { |
| 500 | year++; |
| 501 | } |
| 502 | } else { |
| 503 | year--; |
| 504 | } |
| 505 | |
| 506 | return year; |
| 507 | |
| 508 | } |
| 509 | |
| 510 | @Override |
| 511 | public boolean isValid( |
no test coverage detected