public class DateString
extends java.lang.Object
Constructor and Description |
---|
DateString()
Constructs a new date string with current date.
|
DateString(java.util.Date theDate)
Constructs a new date string.
|
DateString(java.util.Locale locale)
Constructs a new date string with current date.
|
DateString(java.util.Locale locale,
java.util.Date theDate)
Constructs a new date string.
|
DateString(java.util.Locale locale,
java.lang.String editableDateString)
Constructs a new date string.
|
DateString(java.lang.String editableDateString)
Constructs a new date string using the default locale.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
dateString(java.lang.String editableDateString)
Returns the specified editable date string as date string (YYYY-MM-DD)
|
protected java.lang.String |
editableDateString(java.lang.String dateString)
Returns the specified date string (YYYY-MM-DD) as editable date string
|
java.lang.String |
getCrpeCompareString()
Returns the Crystal Reports compare variant of this date string.
|
int |
getDayAsInt()
Returns the day if the date as an int.
|
java.lang.String |
getDayAsString()
Returns the day if the date as a string.
|
java.lang.String |
getEditableDateString()
Returns the date as a locale specific editable date string.
|
java.lang.String |
getEditableDateStringShort()
Returns the date as a locale specific editable date string with 2 digit year.
|
java.lang.String |
getISOString() |
int |
getMonthAsInt()
Returns the month if the date as an int.
|
java.lang.String |
getMonthAsString()
Returns the month if the date as a string.
|
java.lang.String |
getSqlCompareString()
Returns the SQL compare variant of this date string
|
java.sql.Date |
getSqlDate()
Returns the date as an SQL date.
|
int |
getYearAsInt()
Returns the year if the date as an int.
|
java.lang.String |
getYearAsString()
Returns the year if the date as a string.
|
boolean |
isGiven()
Returns true if there is a date given, false if the container represent a leaved out date.
|
boolean |
isValid()
Returns true if the date is valid.
|
static void |
setCenturyLimitValue(int newCenturyLimitValue)
Sets the limit for assuming century in case of short date input.
|
void |
setDate(java.util.Date newDate)
Sets the date.
|
void |
setTodayValue()
Sets the value to today.
|
public DateString()
public DateString(java.util.Date theDate)
theDate
- am SQL date to set the initial valuepublic DateString(java.util.Locale locale)
locale
- the locale to use for formatting functionspublic DateString(java.util.Locale locale, java.util.Date theDate)
locale
- the locale to use for formatting functionstheDate
- am SQL date to set the initial valuepublic DateString(java.lang.String editableDateString)
editableDateString
- an editable date string to set the initial valuepublic DateString(java.util.Locale locale, java.lang.String editableDateString)
locale
- the locale to use for formatting functionseditableDateString
- an editable date string to set the initial valuepublic static void setCenturyLimitValue(int newCenturyLimitValue)
newCenturyLimitValue
- the new century limit valuepublic void setDate(java.util.Date newDate)
newDate
- the new datepublic void setTodayValue()
public boolean isValid()
protected java.lang.String editableDateString(java.lang.String dateString)
dateString
- the date string to formatprotected java.lang.String dateString(java.lang.String editableDateString)
editableDateString
- the editable datepublic boolean isGiven()
public java.lang.String getSqlCompareString()
public java.lang.String getISOString()
public java.lang.String getCrpeCompareString()
public java.sql.Date getSqlDate()
public java.lang.String getEditableDateString()
public java.lang.String getEditableDateStringShort()
public java.lang.String getYearAsString()
public java.lang.String getMonthAsString()
public java.lang.String getDayAsString()
public int getYearAsInt()
public int getMonthAsInt()
public int getDayAsInt()
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de