MCPcopy Create free account
hub / github.com/SeanDragon/protools / toMaxDate

Method toMaxDate

common/src/main/java/pro/tools/time/DatePlus.java:445–469  ·  view source on GitHub ↗
(DateType dateType)

Source from the content-addressed store, hash-verified

443 }
444
445 public DatePlus toMaxDate(DateType dateType) {
446 switch (dateType) {
447 case YEAR:
448 this.localDateTime = LocalDateTime.of(getYear(), 12, 31, 23, 59, 59, 999_999_999);
449 break;
450 case MONTH:
451 this.localDateTime = LocalDateTime.of(getYear(), getMonth(), getLastDayOfMonth().getDayOfMonth(), 23, 59, 59, 999_999_999);
452 break;
453 case DAY:
454 this.localDateTime = LocalDateTime.of(getYear(), getMonth(), getDayOfMonth(), 23, 59, 59, 999_999_999);
455 break;
456 case HOUR:
457 this.localDateTime = LocalDateTime.of(getYear(), getMonth(), getDayOfMonth(), getHour(), 59, 59, 999_999_999);
458 break;
459 case MINUTES:
460 this.localDateTime = LocalDateTime.of(getYear(), getMonth(), getDayOfMonth(), getHour(), getMinute(), 59, 999_999_999);
461 break;
462 case SECONDS:
463 this.localDateTime = LocalDateTime.of(getYear(), getMonth(), getDayOfMonth(), getHour(), getMinute(), getSecond(), 999_999_999);
464 break;
465 default:
466 break;
467 }
468 return this;
469 }
470
471 public Date toDate() {
472 return ToolDatePlus.localDateTime2Date(this.localDateTime);

Callers

nothing calls this directly

Calls 8

getYearMethod · 0.95
getMonthMethod · 0.95
getDayOfMonthMethod · 0.95
getLastDayOfMonthMethod · 0.95
getHourMethod · 0.95
getMinuteMethod · 0.95
getSecondMethod · 0.95
ofMethod · 0.80

Tested by

no test coverage detected