toDateRange

Returns this interval with the precision reduced to just the date.

fun DateTimeInterval.toDateRange(): DateRange
fun OffsetDateTimeInterval.toDateRange(): DateRange
fun ZonedDateTimeInterval.toDateRange(): DateRange

Converts a string to a DateRange.

The string is assumed to be an ISO-8601 time interval representation in extended format. The output of DateRange.toString can be safely parsed using this method.

Examples:

  • 1990-01-04/1991-08-30

  • ../1991-08-30

  • 1990-01-04/..

  • ../..

  • (empty string)

fun String.toDateRange(): DateRange

Converts a string to a DateRange using a specific parser.

A set of predefined parsers can be found in DateTimeParsers.

fun String.toDateRange(parser: GroupedDateTimeParser, settings: DateTimeParserSettings): DateRange