com.sibvisions.rad.ui.qt.ext.text
Class DateFormatter

java.lang.Object
  extended by com.sibvisions.rad.ui.qt.ext.text.DateFormatter

public class DateFormatter
extends Object

The DateFormatter handles complex date formats.


Constructor Summary
DateFormatter()
          Constructs a new date formatter with default date format.
DateFormatter(DateFormat pDateFormat)
          Constructs a new date formatter that supports empty Strings and null values.
 
Method Summary
 DateFormat getDateFormat()
          Gets the date format.
 String getDatePattern()
          Gets the date format pattern.
 void setDateFormat(DateFormat pDateFormat)
          Gets the date format.
 void setDatePattern(String pDatePattern)
          Gets the date format pattern.
 QDateTime toDateTime(String pText)
          Gets the date/time from a txt.
 String toString(QDateTime pValue)
          Gets a string from a date/time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateFormatter

public DateFormatter()
Constructs a new date formatter with default date format.


DateFormatter

public DateFormatter(DateFormat pDateFormat)
Constructs a new date formatter that supports empty Strings and null values.

Parameters:
pDateFormat - the formatter that should support empty Strings and null values.
Method Detail

toDateTime

public QDateTime toDateTime(String pText)
                     throws ParseException
Gets the date/time from a txt.

Parameters:
pText - the text representation
Returns:
the date/time
Throws:
ParseException - if it's not possible to parse the date/time format

toString

public String toString(QDateTime pValue)
                throws ParseException
Gets a string from a date/time.

Parameters:
pValue - the date/time
Returns:
the string representation of date/time
Throws:
ParseException - if the date format is not valid
See Also:
setDateFormat(DateFormat)

getDateFormat

public DateFormat getDateFormat()
Gets the date format.

Returns:
the date format.

setDateFormat

public void setDateFormat(DateFormat pDateFormat)
Gets the date format.

Parameters:
pDateFormat - the date format.

getDatePattern

public String getDatePattern()
Gets the date format pattern.

Returns:
the date format pattern.

setDatePattern

public void setDatePattern(String pDatePattern)
Gets the date format pattern.

Parameters:
pDatePattern - the date format pattern.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.