Class baja.AbsTime
Extends
baja.Simple.
Represents a baja:AbsTime in BajaScript.
AbsTime encapsulates an absolute point in time relative to a given time zone.
When creating a Simple, always use the 'make' method instead of creating a new Object.
Defined in: obj.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
| <static> |
baja.AbsTime.DEFAULT
Default AbsTime instance - maps to Java Epoch.
|
- Fields borrowed from class baja.Value:
- newCopy
- Fields borrowed from class baja.Object:
- equivalent, getIcon
| Method Attributes | Method Name and Description |
|---|---|
|
decodeFromString(str)
Decode an AbsTime from a String.
|
|
|
Encode the AbsTime to a String.
|
|
|
equals(obj)
Equality test.
|
|
|
Return the data type symbol.
|
|
|
getDate()
Return the date.
|
|
|
Return a new JavaScript Date based on this AbsTime.
|
|
|
Return the UTC offset.
|
|
|
getTime()
Return the time.
|
|
| <static> |
baja.AbsTime.make(obj, jsDate)
Make an AbsTime.
|
|
make(obj, offset, jsDate)
Make an AbsTime.
|
|
| <static> |
baja.AbsTime.now()
Make an AbsTime with the current date and time.
|
|
toString(obj)
Return a String representation of the AbsTime.
|
Field Detail
<static>
baja.AbsTime.DEFAULT
Default AbsTime instance - maps to Java Epoch.
Method Detail
{baja.AbsTime}
decodeFromString(str)
Decode an AbsTime from a String.
- Parameters:
- {String} str
- Returns:
- {baja.AbsTime}
{String}
encodeToString()
Encode the AbsTime to a String.
- Returns:
- {String}
{Boolean}
equals(obj)
Equality test.
- Parameters:
- obj
- Returns:
- {Boolean}
{String}
getDataTypeSymbol()
Return the data type symbol.
- Returns:
- {String}
{baja.Date}
getDate()
Return the date.
- Returns:
- {baja.Date}
{Date}
getJsDate()
Return a new JavaScript Date based on this AbsTime.
Please, note the AbsTime UTC offset is ignored.
- Returns:
- {Date}
{Number}
getOffset()
Return the UTC offset.
- Returns:
- {Number}
{baja.Time}
getTime()
Return the time.
- Returns:
- {baja.Time}
<static>
baja.AbsTime.make(obj, jsDate)
Make an AbsTime.
An Object Literal is used for the method's arguments...
var at1 = baja.AbsTime.make({
date: baja.Date.make({year: 1981, month: 5, day: 17}),
time: baja.Time.make({hour: 15, min: 30}),
offset: 0
});
// ...or from a JavaScript Date (UTC offset is ignored)...
var at2 = baja.AbsTime.make({jsDate: new Date()});
- Parameters:
- {Object} obj Optional
- the Object Literal used for the method's arguments.
- {baja.Date} obj.date Optional
- {baja.Time} obj.time Optional
- {Number} obj.offset Optional
- UTC offset in milliseconds.
- {Date} jsDate Optional
- if defined, this date is used for the date and time. The UTC offset from this date is currently ignored (the offset argument is used) This will override the date and time arguments.
- Returns:
- baja.AbsTime
make(obj, offset, jsDate)
Make an AbsTime.
An Object Literal is used for the method's arguments...
var at1 = baja.$("baja:AbsTime").make({
date: baja.$("baja:Date").make({year: 1981, month: 5, day: 17}),
time: baja.$("baja:Time").make({hour: 15, min: 30}),
offset: 0
});
// ...or from a JavaScript Date...
var at2 = baja.$("baja:AbsTime").make({jsDate: new Date(), offset: 5});
- Parameters:
- {Object} obj Optional
- the Object Literal used for the method's arguments.
- {baja.Date} obj.date Optional
- {baja.Time} obj.time Optional
- {Number} offset Optional
- {Date} jsDate Optional
- if defined, this date is used for the date and time. The UTC offset from this date is currently ignored (the offset argument is used) This will override the date and time arguments.
- Returns:
- baja.AbsTime
<static>
{baja.AbsTime}
baja.AbsTime.now()
Make an AbsTime with the current date and time.
- Returns:
- {baja.AbsTime}
{String}
toString(obj)
Return a String representation of the AbsTime.
- Parameters:
- {Object} obj Optional
- the Object Literal for the method's arguments.
- {Number} obj.show Optional
- flags used to format the time. For more information, please see baja.TimeFormat.
- Returns:
- {String}