TimeRange
Static Method Summary
Static Public Methods | ||
public static |
lastDay(): * |
|
public static |
lastNinetyDays(): * |
|
public static |
lastSevenDays(): * |
|
public static |
lastThirtyDays(): * |
Constructor Summary
Public Constructor | ||
public |
constructor(arg1: *, arg2: *) Builds a new TimeRange which may be of several different formats: |
Method Summary
Public Methods | ||
public |
Returns the begin time of the TimeRange. |
|
public |
Returns true if other is completely inside this. |
|
public |
disjoint(other: *): * Returns true if the passed in other Range in no way |
|
public |
duration(): * |
|
public |
Returns the end time of the TimeRange. |
|
public |
equals(other: *): * Returns if the two TimeRanges can be considered equal, |
|
public |
extents(other: *): * Returns a new Timerange which covers the extents of this and |
|
public |
Returns a human friendly version of the TimeRange, e.g. |
|
public |
humanizeDuration(): * |
|
public |
intersection(other: *): * Returns a new TimeRange which represents the intersection |
|
public |
Returns true if the passed in other TimeRange overlaps this time Range. |
|
public |
range(): * Returns the internal range, which is an Immutable List containing |
|
public |
Returns a human friendly version of the TimeRange, e.g. |
|
public |
setBegin(t: *): * Sets a new begin time on the TimeRange. |
|
public |
setEnd(t: *): * Sets a new end time on the TimeRange. |
|
public |
Returns the TimeRange as JSON, which will be a Javascript array |
|
public |
Returns the TimeRange as a string expressed in local time |
|
public |
Returns the TimeRange as a string, useful for serialization. |
|
public |
Returns the TimeRange as a string expressed in UTC time |
|
public |
within(other: *): * Returns true if this TimeRange is completely within the supplied |
Static Public Methods
Public Constructors
public constructor(arg1: *, arg2: *) source
Builds a new TimeRange which may be of several different formats:
- Another TimeRange (copy constructor)
- An Immutable.List containing two Dates.
- A Javascript array containing two Date or ms timestamps
- Two arguments, begin and end, each of which may be a Data, a Moment, or a ms timestamp.
Params:
Name | Type | Attribute | Description |
arg1 | * | ||
arg2 | * |
Public Methods
public contains(other: *): boolean source
Returns true if other is completely inside this.
Params:
Name | Type | Attribute | Description |
other | * |
public disjoint(other: *): * source
Returns true if the passed in other Range in no way overlaps this time Range.
Params:
Name | Type | Attribute | Description |
other | * |
Return:
* |
public equals(other: *): * source
Returns if the two TimeRanges can be considered equal, in that they have the same times.
Params:
Name | Type | Attribute | Description |
other | * |
Return:
* |
public extents(other: *): * source
Returns a new Timerange which covers the extents of this and other combined.
Params:
Name | Type | Attribute | Description |
other | * |
Return:
* |
public humanize(): string source
Returns a human friendly version of the TimeRange, e.g. "Aug 1, 2014 05:19:59 am to Aug 1, 2014 07:41:06 am"
public intersection(other: *): * source
Returns a new TimeRange which represents the intersection (overlapping) part of this and other.
Params:
Name | Type | Attribute | Description |
other | * |
Return:
* |
public overlaps(other: *): boolean source
Returns true if the passed in other TimeRange overlaps this time Range.
Params:
Name | Type | Attribute | Description |
other | * |
public range(): * source
Returns the internal range, which is an Immutable List containing begin and end keys
Return:
* |
public relativeString(): string source
Returns a human friendly version of the TimeRange, e.g. e.g. "a few seconds ago to a month ago"
public setBegin(t: *): * source
Sets a new begin time on the TimeRange. The result will be a new TimeRange.
Params:
Name | Type | Attribute | Description |
t | * |
Return:
* |
public setEnd(t: *): * source
Sets a new end time on the TimeRange. The result will be a new TimeRange.
Params:
Name | Type | Attribute | Description |
t | * |
Return:
* |
public toJSON(): number[] source
Returns the TimeRange as JSON, which will be a Javascript array of two ms timestamps.
public within(other: *): * source
Returns true if this TimeRange is completely within the supplied other TimeRange.
Params:
Name | Type | Attribute | Description |
other | * |
Return:
* |