DateTimeRange

data class DateTimeRange(val from: DateTime, val to: DateTime) : Comparable<DateTime> , Serializable

Represents a right-opened range between two dates.

Constructors

Link copied to clipboard
constructor(from: DateTime, to: DateTime)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Duration TimeSpan without having into account actual months/years.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

DateTimeSpan distance between two dates, month and year aware.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun compareTo(other: DateTime): Int
Link copied to clipboard
operator fun contains(date: DateTime): Boolean

Checks if a date is contained in this range.

operator fun contains(other: DateTimeRange): Boolean
Link copied to clipboard
fun intersectionWith(that: DateTimeRange, rightOpen: Boolean = true): DateTimeRange?

Returns new DateTimeRange or null - the result of intersection of this and that DateTimeRanges.

Link copied to clipboard

Returns true if this and that DateTimeRanges have intersection or at least a common end otherwise false.

Link copied to clipboard
fun intersectsWith(that: DateTimeRange, rightOpen: Boolean = true): Boolean

Returns true if this and that DateTimeRanges have intersection otherwise false.

Link copied to clipboard

Returns new DateTimeRange or null - the result of merging this and that DateTimeRanges if they have intersection.

Link copied to clipboard
open override fun toString(): String
fun toString(format: DateFormat): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns a List of 0, 1 or 2 DateTimeRanges - the result of removing that DateTimeRange from this one