class DateRange
Represents a range of dates, corresponding to the Apache Solr type
DateRangeField
.
A date range can have one or two bounds, namely lower bound and upper bound, to represent an interval of time. Date range bounds are both inclusive. For example:
-
2015 TO 2016-10
represents from the first day of 2015 to the last day of October 2016 -
2015
represents during the course of the year 2015. -
2017 TO *
represents any date greater or equals to the first day of the year 2017.
Note that this JavaScript representation of DateRangeField
does not support Dates outside of the range
supported by ECMAScript Date: –100,000,000 days to 100,000,000 days measured relative to midnight at the
beginning of 01 January, 1970 UTC. Being -271821-04-20T00:00:00.000Z
the minimum lower boundary
and 275760-09-13T00:00:00.000Z
the maximum higher boundary.
- Static
- This class is static
Members
DateRangeBound
lowerBound
Gets the lower bound of this range (inclusive).
Gets the upper bound of this range (inclusive).
Constructor
DateRange
(DateRangeBound
lowerBound, [DateRangeBound
upperBound])
Creates a new instance of DateRange
using a lower bound and an upper bound.
Consider using DateRange.fromString()
to create instances more easily.
Methods
equals
(DateRange
other)
Returns true if the value of this DateRange instance and other are the same.
DateRange.fromBuffer
(Buffer
buffer)
Deserializes the buffer into a DateRange
- Static
- This function is static
DateRange.fromString
(String
dateRangeString)
Returns the DateRange
representation of a given string.
String representations of dates are always expressed in Coordinated Universal Time (UTC)
- Static
- This function is static
toString
()Returns the string representation of the instance.