Package com.github.lgooddatepicker.zinternaltools

# Class CalculateMinimumTimeFieldSize

java.lang.Object
com.github.lgooddatepicker.zinternaltools.CalculateMinimumTimeFieldSize

public class CalculateMinimumTimeFieldSize extends Object
CalculateMinimumTimeFieldSize, This class is used to calculate the minimum horizontal size needed for text fields that hold times. (Such as the text field in the TimePicker component.) The size that is returned is designed to be the smallest size that will hold the longest displayable time under current TimePickerSettings, without cropping the text. The "longest time", needs to take into account the following factors: The longest (in pixels) time in the current display format, and the font object for valid times (including the font type and size). Note that the locale information is built into the display format.

## Constructor Summary

Constructors
Constructor
Description
`CalculateMinimumTimeFieldSize()`

## Method Summary

Modifier and Type
Method
Description
`static int`
`getFormattedTimeWidthInPixels(DateTimeFormatter formatForDisplayTime, Font fontValidTime, int numberOfExtraCharacters)`
getFormattedDateWidthInPixels, This returns the width (in pixels) of the longest formatted time, using the supplied DateTimeFormatter instance and font.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CalculateMinimumTimeFieldSize

public CalculateMinimumTimeFieldSize()

## Method Details

### getFormattedTimeWidthInPixels

public static int getFormattedTimeWidthInPixels(DateTimeFormatter formatForDisplayTime, Font fontValidTime, int numberOfExtraCharacters)
getFormattedDateWidthInPixels, This returns the width (in pixels) of the longest formatted time, using the supplied DateTimeFormatter instance and font. Note that the locale information is built into the display format. You may optionally add extra characters to the longestTimeString that is used in the calculation, by supplying a nonzero value for the parameter numberOfExtraCharacters. This parameter can also be used with a negative value to reduce the size that is returned.