Skip to content

Commit

Permalink
Fix various documentation issues (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikc5000 committed Apr 21, 2022
1 parent 27c6e69 commit ae4d23b
Show file tree
Hide file tree
Showing 25 changed files with 520 additions and 266 deletions.
100 changes: 40 additions & 60 deletions core/src/commonMain/generated/io/islandtime/_DateProperties.kt
Expand Up @@ -46,9 +46,8 @@ public fun Date.week(settings: WeekSettings): DateRange =
* The range defining the week that this date falls within. The first day of the week will be the
* default associated with the provided [locale].
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*/
public fun Date.week(locale: Locale): DateRange = startOfWeek(locale).let { it..it + 6.days }

Expand All @@ -67,9 +66,8 @@ public fun Date.weekOfMonth(settings: WeekSettings): Int = weekOfMonthImpl(setti
* The week of the month, from 0-6, calculated using the default week definition associated with the
* provided [locale].
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*/
public fun Date.weekOfMonth(locale: Locale): Int = weekOfMonthImpl(locale.weekSettings)

Expand Down Expand Up @@ -100,9 +98,8 @@ public fun Date.weekOfYear(settings: WeekSettings): Int = weekOfYearImpl(setting
*
* To obtain the week number of the week-based year, use [weekOfWeekBasedYear] instead.
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*
* @see weekOfWeekBasedYear
*/
Expand Down Expand Up @@ -131,9 +128,8 @@ public fun Date.weekBasedYear(settings: WeekSettings): Int = weekBasedYearImpl(s
* This value differs from the regular ISO year when the week number falls in the preceding or
* following year.
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*
* @see weekOfWeekBasedYear
*/
Expand All @@ -158,9 +154,8 @@ public fun Date.weekOfWeekBasedYear(settings: WeekSettings): Int = weekOfWeekBas
* The week number of the week-based year, calculated using the week definition associated with the
* provided [locale].
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*
* @see weekBasedYear
*/
Expand Down Expand Up @@ -254,9 +249,8 @@ public fun DateTime.week(settings: WeekSettings): DateTimeInterval =
* The interval defining the week that this date-time falls within. The first day of the week will
* be the default associated with the provided [locale].
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*/
public fun DateTime.week(locale: Locale): DateTimeInterval =
startOfWeek(locale).let { it until it + 7.days }
Expand All @@ -276,9 +270,8 @@ public fun DateTime.weekOfMonth(settings: WeekSettings): Int = date.weekOfMonth(
* The week of the month, from 0-6, calculated using the default week definition associated with the
* provided [locale].
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*/
public fun DateTime.weekOfMonth(locale: Locale): Int = date.weekOfMonth(locale)

Expand Down Expand Up @@ -309,9 +302,8 @@ public fun DateTime.weekOfYear(settings: WeekSettings): Int = date.weekOfYear(se
*
* To obtain the week number of the week-based year, use [weekOfWeekBasedYear] instead.
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*
* @see weekOfWeekBasedYear
*/
Expand Down Expand Up @@ -340,9 +332,8 @@ public fun DateTime.weekBasedYear(settings: WeekSettings): Int = date.weekBasedY
* This value differs from the regular ISO year when the week number falls in the preceding or
* following year.
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*
* @see weekOfWeekBasedYear
*/
Expand All @@ -368,9 +359,8 @@ public fun DateTime.weekOfWeekBasedYear(settings: WeekSettings): Int =
* The week number of the week-based year, calculated using the week definition associated with the
* provided [locale].
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*
* @see weekBasedYear
*/
Expand Down Expand Up @@ -447,9 +437,8 @@ public fun OffsetDateTime.week(settings: WeekSettings): OffsetDateTimeInterval =
* The interval defining the week that this date-time falls within. The first day of the week will
* be the default associated with the provided [locale].
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*/
public fun OffsetDateTime.week(locale: Locale): OffsetDateTimeInterval =
startOfWeek(locale).let { it until it + 7.days }
Expand All @@ -469,9 +458,8 @@ public fun OffsetDateTime.weekOfMonth(settings: WeekSettings): Int = dateTime.we
* The week of the month, from 0-6, calculated using the default week definition associated with the
* provided [locale].
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*/
public fun OffsetDateTime.weekOfMonth(locale: Locale): Int = dateTime.weekOfMonth(locale)

Expand Down Expand Up @@ -502,9 +490,8 @@ public fun OffsetDateTime.weekOfYear(settings: WeekSettings): Int = dateTime.wee
*
* To obtain the week number of the week-based year, use [weekOfWeekBasedYear] instead.
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*
* @see weekOfWeekBasedYear
*/
Expand Down Expand Up @@ -534,9 +521,8 @@ public fun OffsetDateTime.weekBasedYear(settings: WeekSettings): Int =
* This value differs from the regular ISO year when the week number falls in the preceding or
* following year.
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*
* @see weekOfWeekBasedYear
*/
Expand All @@ -562,9 +548,8 @@ public fun OffsetDateTime.weekOfWeekBasedYear(settings: WeekSettings): Int =
* The week number of the week-based year, calculated using the week definition associated with the
* provided [locale].
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*
* @see weekBasedYear
*/
Expand Down Expand Up @@ -644,9 +629,8 @@ public fun ZonedDateTime.week(settings: WeekSettings): ZonedDateTimeInterval =
* The interval defining the week that this date-time falls within. The first day of the week will
* be the default associated with the provided [locale].
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*/
public fun ZonedDateTime.week(locale: Locale): ZonedDateTimeInterval =
startOfWeek(locale).let { it until it + 7.days }
Expand All @@ -666,9 +650,8 @@ public fun ZonedDateTime.weekOfMonth(settings: WeekSettings): Int = dateTime.wee
* The week of the month, from 0-6, calculated using the default week definition associated with the
* provided [locale].
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*/
public fun ZonedDateTime.weekOfMonth(locale: Locale): Int = dateTime.weekOfMonth(locale)

Expand Down Expand Up @@ -699,9 +682,8 @@ public fun ZonedDateTime.weekOfYear(settings: WeekSettings): Int = dateTime.week
*
* To obtain the week number of the week-based year, use [weekOfWeekBasedYear] instead.
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*
* @see weekOfWeekBasedYear
*/
Expand Down Expand Up @@ -731,9 +713,8 @@ public fun ZonedDateTime.weekBasedYear(settings: WeekSettings): Int =
* This value differs from the regular ISO year when the week number falls in the preceding or
* following year.
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*
* @see weekOfWeekBasedYear
*/
Expand All @@ -759,9 +740,8 @@ public fun ZonedDateTime.weekOfWeekBasedYear(settings: WeekSettings): Int =
* The week number of the week-based year, calculated using the week definition associated with the
* provided [locale].
*
* Keep in mind that that the system's calendar settings may differ from that of the default locale
* on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault]
* instead.
* Keep in mind that the system's calendar settings may differ from that of the default locale on
* some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead.
*
* @see weekBasedYear
*/
Expand Down
54 changes: 39 additions & 15 deletions core/src/commonMain/generated/io/islandtime/measures/_Centuries.kt
Expand Up @@ -53,13 +53,17 @@ public value class Centuries(
public val `value`: Long,
) : Comparable<Centuries> {
/**
* The absolute value of this duration. @throws ArithmeticException if overflow occurs
* The absolute value of this duration.
*
* @throws ArithmeticException if overflow occurs
*/
public val absoluteValue: Centuries
get() = Centuries(absExact(value))

/**
* Converts this duration to months. @throws ArithmeticException if overflow occurs
* Converts this duration to months.
*
* @throws ArithmeticException if overflow occurs
*/
public val inMonths: Months
get() = Months(value timesExact MONTHS_PER_CENTURY)
Expand All @@ -71,7 +75,9 @@ public value class Centuries(
get() = Months(value * MONTHS_PER_CENTURY)

/**
* Converts this duration to years. @throws ArithmeticException if overflow occurs
* Converts this duration to years.
*
* @throws ArithmeticException if overflow occurs
*/
public val inYears: Years
get() = Years(value timesExact YEARS_PER_CENTURY)
Expand All @@ -83,7 +89,9 @@ public value class Centuries(
get() = Years(value * YEARS_PER_CENTURY)

/**
* Converts this duration to decades. @throws ArithmeticException if overflow occurs
* Converts this duration to decades.
*
* @throws ArithmeticException if overflow occurs
*/
public val inDecades: Decades
get() = Decades(value timesExact DECADES_PER_CENTURY)
Expand Down Expand Up @@ -145,7 +153,9 @@ public value class Centuries(
}

/**
* Negates this duration. @throws ArithmeticException if overflow occurs
* Negates this duration.
*
* @throws ArithmeticException if overflow occurs
*/
public operator fun unaryMinus(): Centuries = Centuries(value.negateExact())

Expand Down Expand Up @@ -173,13 +183,16 @@ public value class Centuries(
centuries.value)

/**
* Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs
* Multiplies this duration by a scalar value.
*
* @throws ArithmeticException if overflow occurs
*/
public operator fun times(scalar: Int): Centuries = Centuries(value timesExact scalar)

/**
* Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs
* or the scalar is zero
* Returns this duration divided by a scalar value.
*
* @throws ArithmeticException if overflow occurs or the scalar is zero
*/
public operator fun div(scalar: Int): Centuries {
return if (scalar == -1) {
Expand All @@ -195,13 +208,16 @@ public value class Centuries(
public operator fun rem(scalar: Int): Centuries = Centuries(value % scalar)

/**
* Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs
* Multiplies this duration by a scalar value.
*
* @throws ArithmeticException if overflow occurs
*/
public operator fun times(scalar: Long): Centuries = Centuries(value timesExact scalar)

/**
* Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs
* or the scalar is zero
* Returns this duration divided by a scalar value.
*
* @throws ArithmeticException if overflow occurs or the scalar is zero
*/
public operator fun div(scalar: Long): Centuries {
return if (scalar == -1L) {
Expand All @@ -217,7 +233,9 @@ public value class Centuries(
public operator fun rem(scalar: Long): Centuries = Centuries(value % scalar)

/**
* Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs
* Converts this duration to an `Int` value.
*
* @throws ArithmeticException if overflow occurs
*/
public fun toInt(): Int = value.toIntExact()

Expand All @@ -227,7 +245,9 @@ public value class Centuries(
internal fun toIntUnchecked(): Int = value.toInt()

/**
* Converts this duration to [IntCenturies]. @throws ArithmeticException if overflow occurs
* Converts this duration to [IntCenturies].
*
* @throws ArithmeticException if overflow occurs
*/
@Deprecated(
message = "The 'Int' class no longer exists.",
Expand Down Expand Up @@ -277,7 +297,9 @@ public val Int.centuries: Centuries
get() = Centuries(this)

/**
* Multiplies this value by a duration of centuries. @throws ArithmeticException if overflow occurs
* Multiplies this value by a duration of centuries.
*
* @throws ArithmeticException if overflow occurs
*/
public operator fun Int.times(centuries: Centuries): Centuries = centuries * this

Expand All @@ -288,6 +310,8 @@ public val Long.centuries: Centuries
get() = Centuries(this)

/**
* Multiplies this value by a duration of centuries. @throws ArithmeticException if overflow occurs
* Multiplies this value by a duration of centuries.
*
* @throws ArithmeticException if overflow occurs
*/
public operator fun Long.times(centuries: Centuries): Centuries = centuries * this

0 comments on commit ae4d23b

Please sign in to comment.