class DateRange : DateDayProgression, ClosedRange<Date>
An inclusive range of dates.
Date.MIN and Date.MAX are used as sentinels to indicate an unbounded (ie. infinite) start or end.
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
<init> |
An inclusive range of dates. <init>(start: Date = Date.MIN, endInclusive: Date = Date.MAX) |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
endInclusive |
val endInclusive: Date |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
lengthInDays |
Get the number of days in the range. As a range is inclusive, if the start and end date are the same, the result will be one day. val lengthInDays: LongDays |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
lengthInMonths |
Get the number of months in the range. A month is considered to have passed if the day of the end month is greater than or equal to the day of the start month minus one (as a range is inclusive). val lengthInMonths: IntMonths |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
lengthInWeeks |
Get the number of weeks in the range. val lengthInWeeks: LongWeeks |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
lengthInYears |
Get the number of years in the range. A year is considered to have passed if twelve full months have passed between the start date and end date, according to the definition of 'month' in lengthInMonths. val lengthInYears: IntYears |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
start |
val start: Date |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
asPeriod |
Convert a range of dates into a period containing each day in the range. As a range is inclusive, if the start and end date are the same, the resulting period will contain one day. fun asPeriod(): Period |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
equals |
fun equals(other: Any?): Boolean |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
hasBoundedEnd |
fun hasBoundedEnd(): Boolean |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
hasBoundedStart |
fun hasBoundedStart(): Boolean |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
hashCode |
fun hashCode(): Int |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
hasUnboundedEnd |
fun hasUnboundedEnd(): Boolean |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
hasUnboundedStart |
fun hasUnboundedStart(): Boolean |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
isBounded |
fun isBounded(): Boolean |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
isEmpty |
Is the progression empty? fun isEmpty(): Boolean |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
isUnbounded |
fun isUnbounded(): Boolean |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
toString |
Converts this range to a string in ISO-8601 extended format. fun toString(): String |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
EMPTY |
A range containing zero days. val EMPTY: DateRange |
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)
UNBOUNDED |
An unbounded (ie. infinite) range of dates. val UNBOUNDED: DateRange |
(jvm)
random |
Return a random date within the range using the supplied random number generator. fun DateRange.random(random: Random): Date |
(jvm)
randomOrNull |
Return a random date within the range using the supplied random number generator or fun DateRange.randomOrNull(random: Random): Date? |