MCPcopy Create free account
hub / github.com/MenoData/Time4J / getHour12

Method getHour12

base/src/main/java/net/time4j/DayPeriod.java:730–741  ·  view source on GitHub ↗
(ChronoEntity<?> entity)

Source from the content-addressed store, hash-verified

728 }
729
730 private static int getHour12(ChronoEntity<?> entity) {
731 int hour12 = -1;
732 if (entity.contains(PlainTime.CLOCK_HOUR_OF_AMPM)) {
733 hour12 = entity.get(PlainTime.CLOCK_HOUR_OF_AMPM).intValue();
734 if (hour12 == 12) {
735 hour12 = 0;
736 }
737 } else if (entity.contains(PlainTime.DIGITAL_HOUR_OF_AMPM)) {
738 hour12 = entity.get(PlainTime.DIGITAL_HOUR_OF_AMPM).intValue();
739 }
740 return hour12;
741 }
742
743 private static DayPeriod from(
744 Locale locale,

Callers 1

resolveMethod · 0.95

Calls 2

containsMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected