Package com.guflimc.brick.i18n.api.time
Class DurationFormatter
java.lang.Object
com.guflimc.brick.i18n.api.time.DurationFormatter
-
Field Summary
Modifier and TypeFieldDescriptionstatic final DurationFormatter
Compact format with period and duration.static final DurationFormatter
Cozy format with period and duration.static final DurationFormatter
Digital clock format.static final int
A value of a temporal field will not be formatted in the final result if the temporal field's value and any subsequent temporal field's value in the format for the given temporal amount is zero.static final int
A value of a temporal field will not be formatted in the final result if the temporal amount is less than the temporal field's base unit duration.static final int
A value of a temporal field will not be formatted in the final result if the temporal field's value for the given temporal amount is zero.static final DurationFormatter
Format only the highest unit of value. -
Method Summary
-
Field Details
-
FLAG_SKIP_ZERO
public static final int FLAG_SKIP_ZEROA value of a temporal field will not be formatted in the final result if the temporal field's value for the given temporal amount is zero. e.g. if the temporal amount is 2 years and 17 days, the result will be "2y 17d" and not "2y 0m 17d".- See Also:
-
FLAG_SKIP_OUT_OF_UPPER_BOUND
public static final int FLAG_SKIP_OUT_OF_UPPER_BOUNDA value of a temporal field will not be formatted in the final result if the temporal amount is less than the temporal field's base unit duration. e.g. if the temporal amount is 3 months and 24 days, the result will be "3m 24d" and not "0y 3m 24d".- See Also:
-
FLAG_SKIP_OUT_OF_LOWER_BOUND
public static final int FLAG_SKIP_OUT_OF_LOWER_BOUNDA value of a temporal field will not be formatted in the final result if the temporal field's value and any subsequent temporal field's value in the format for the given temporal amount is zero. This only applies when at least one prior temporal field's value is non-zero. e.g. if the temporal amount is 1 year and 7 months, the result will be "1y 7m" and not "1y 7m 0d".- See Also:
-
DIGITAL
Digital clock format. e.g. for 7 hours, 38 minutes and 12 seconds, the result will be "07:38:12". -
COZY
Cozy format with period and duration. e.g. for 3 days and 38 minutes the result will be "3D 0h 38m". -
COMPACT
Compact format with period and duration. e.g. for 3 days and 38 minutes the result will be "3D 38m". -
HIGHEST
Format only the highest unit of value. e.g. for 7 months, 26 days and 22 hours the result will be "7m".
-
-
Method Details
-
format
-