Represents a date range boundary, composed by a Date and a precision.

Static
This class is static

Members

Date

date

The timestamp portion of the boundary.

Number

precision

The precision portion of the boundary. Valid values are defined in the dateRangePrecision member.

DateRangeBound

DateRangeBound.unbounded

The unbounded DateRangeBound instance. Unbounded bounds are syntactically represented by a * (star) sign.

Static
This member is static

Constructor

new

DateRangeBound

(Date date, Number precision)
Parameters:
Name Type Description
date Date

The timestamp portion, representing a single moment in time. Consider using Date.UTC() method to build the Date instance.

precision Number

The precision portion. Valid values for DateRangeBound precision are defined in the dateRangePrecision member.

Methods

equals

(DateRangeBound other)

Returns true if the value of this DateRange instance and other are the same.

Parameters:
Name Type Description
other DateRangeBound
Returns:
Type Description
boolean

DateRangeBound.fromString

(String boundaryString)

Parses a date string and returns a DateRangeBound.

Static
This function is static
Parameters:
Name Type Description
boundaryString String
Returns:
Type Description
DateRangeBound

DateRangeBound.toLowerBound

(DateRangeBound bound)

Converts a {DateRangeBound} into a lower-bounded bound by rounding down its date based on its precision.

Static
This function is static
Parameters:
Name Type Description
bound DateRangeBound

The bound to round down.

Returns:
Type Description
DateRangeBound

with the date rounded down to the given precision.

toString

()

Returns the string representation of the instance.

Returns:
Type Description
String

DateRangeBound.toUpperBound

(DateRangeBound bound)

Converts a {DateRangeBound} into a upper-bounded bound by rounding up its date based on its precision.

Static
This function is static
Parameters:
Name Type Description
bound DateRangeBound

The bound to round up.

Returns:
Type Description
DateRangeBound

with the date rounded up to the given precision.