Creates a HybridDate validating the input. @param prolepticYear the British Cutover proleptic-year @param month the British Cutover month-of-year, from 1 to 12 @param dayOfMonth the British Cutover day-of-month, from 1 to 31 @return the date in British Cutover calendar system, no
(int prolepticYear, int month, int dayOfMonth)
| 216 | * or if the day-of-month is invalid for the month-year |
| 217 | */ |
| 218 | static HybridDate create(int prolepticYear, int month, int dayOfMonth) { |
| 219 | if (prolepticYear < CUTOVER_YEAR) { |
| 220 | JulianDate julian = JulianDate.of(prolepticYear, month, dayOfMonth); |
| 221 | return new HybridDate(julian); |
| 222 | } else { |
| 223 | LocalDate iso = LocalDate.of(prolepticYear, month, dayOfMonth); |
| 224 | if (iso.isBefore(CUTOVER)) { |
| 225 | JulianDate julian = JulianDate.of(prolepticYear, month, dayOfMonth); |
| 226 | return new HybridDate(julian); |
| 227 | } |
| 228 | return new HybridDate(iso); |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | //----------------------------------------------------------------------- |
| 233 |
no test coverage detected