Class $k.Time
Represents a time without timezone
- Defined in: Time.js
Constructor Attributes | Constructor Name and Description |
---|---|
$k.Time(hours, minutes, seconds)
Constructs a Time from the argument(s), which can be a Date object, undefined, or component values.
|
Method Summary
Class Detail
$k.Time(hours, minutes, seconds)
Constructs a Time from the argument(s), which can be a Date object, undefined, or component values.
If undefined, the current time is returned
- Parameters:
- hours Optional
- Date or hours
- minutes Optional
- Minutes
- seconds Optional
- Seconds
Method Detail
-
{boolean} equals(value)Returns true if the values are equal
- Parameters:
- value
- Returns:
- {boolean}
-
{number} getHours()Returns the hours
- Returns:
- {number}
-
{number} getMinutes()Returns the minutes
- Returns:
- {number}
-
{number} getSeconds()Returns the seconds
- Returns:
- {number}
-
Returns the latest exact Javascript date that is within the range of this date/time, e.g. 2007-03-01T23:59:59.999 for the date 2007-03-01. Assumes that this is date/time of the local timezone
- Returns:
- {$k.Date}
-
Returns the latest exact Javascript date that is within the range of this date/time, e.g. 2007-03-01T23:59:59.999 for the date 2007-03-01. Assumes that this is date/time of the local timezone
- Returns:
- {$k.Date}
-
Returns the earliest exact Javascript date that is within the range of this date/time, e.g. 2007-03-01T0:00:00.0 for the date 2007-03-01. Assumes that this is date/time of the local timezone
- Returns:
- {$k.Date}
-
Returns the earliest exact Javascript date that is within the range of this date/time, e.g. 2007-03-01T0:00:00.0 for the date 2007-03-01. Assumes that this is an UTC date/time
- Returns:
- {$k.Date}
-
<static> $k.Time.parse(string, language)Parse the date/time string. Both ISO 8601 adnd localized strings are supported.
- Parameters:
- {string} string
- The string representation
- {string} language Optional
- Language of the value. If not defined, the current language will be used. Ignored if the attribute is not translated
- Throws:
- {$k.exception.InvalidLanguage}
- If an invalid language was specified
- Returns:
- The parsed date/time
-
setHours(hours)Sets the hours
- Parameters:
- {number} hours
-
setMinutes(minutes)Sets the minutes.
- Parameters:
- {number} minutes
-
setSeconds(seconds)Sets the seconds.
- Parameters:
- {number} seconds
-
toDate()Returns the date/time as a Javascript date object. Assumes that this is date/time of the local timezone
-
toJSON(key)Returns a string representing the date/time, similar to Date.prototype.toJSON ( key )
- Parameters:
- key
- See:
- $k.Date#toJSON
-
{string} toString(language)Returns the string representation. Equivalent to valueString()
- Parameters:
- {string} language Optional
- Language of the value. If not defined, the current language will be used. Ignored if the attribute is not translated
- Throws:
- {$k.exception.InvalidLanguage}
- If an invalid language was specified
- Returns:
- {string}
-
toUTCDate()Returns the date/time as a Javascript date object. Assumes that this is an UTC date/time
-
{string} valueString(language)Returns the string representation
- Parameters:
- {string} language Optional
- Language of the value. If not defined, the current language will be used. Ignored if the attribute is not translated
- Throws:
- {$k.exception.InvalidLanguage}
- If an invalid language was specified
- Returns:
- {string}