java.lang.Objecttelosys.objects.SimpleDate
Simple date utility object for date management. Used by field checking functions ( see fwkCheckAndFormatDate ) The date formats are not case sensitive, any separators can be used ( '/', '-', '.', etc... ) Examples : "DDMMYY", "YY-MM-DD", "YYYY.DD.MM", "DD/MM/YY", "dd/MM/yyyy"
Constructor Summary | |
SimpleDate(string sDate)
Creates a new date object using the given date value and the default format "YYYY-MM-DD" ( ISO format ) |
|
SimpleDate(string sDate,
string sFormat)
Creates a new date object using the given date value and the given format |
Method Summary | |
string |
format()
Formats the current date with the current format |
string |
format(string sFormat)
Formats the current date with the given format |
number |
getDay()
Returns the day ( 1 to 31 ) |
string |
getFormat()
Returns the current format |
number |
getMonth()
Returns the month ( 1 to 12 ) |
number |
getYear()
Returns the year ( 0 to N ) |
boolean |
isNull()
Returns true if the current date is null, else false |
void |
setDate(string sDate)
Try to set the new date value according with the current format. |
void |
setFormat(string sFormat)
Sets the new date format |
void |
show()
Shows the date description and current values ( with an 'alert box' ). |
string |
toString_()
Returns the date current values ( day, month, year and format ) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleDate(string sDate) throws java.lang.Exception
sDate
- : the date value (according with the ISO format) or null
java.lang.Exception
- if the given date is invalidpublic SimpleDate(string sDate, string sFormat) throws java.lang.Exception
sDate
- : the date value (according with the given format) or nullsFormat
- : e.g. "" ( not case sensitive )
java.lang.Exception
- if the given date or format is invalidMethod Detail |
public string toString_()
public void show()
public string format()
public string format(string sFormat) throws java.lang.Exception
sFormat
- : the format to apply ( not case sensitive )
java.lang.Exception
- if the given format is invalidpublic boolean isNull()
public number getDay()
public number getMonth()
public number getYear()
public string getFormat()
public void setFormat(string sFormat) throws java.lang.Exception
sFormat
- the new format
java.lang.Exception
- if the given format is invalidpublic void setDate(string sDate) throws java.lang.Exception
sDate
- : the new date ( "311208", "31-12-08", "31.12.2008", etc...) to set or null
java.lang.Exception
- if the given date is invalid