Skip to content

Commit a971c2f

Browse files
committed
Don't hyphenate ISO 8601 when used as a compound adjective
1 parent 59b18e0 commit a971c2f

18 files changed

+25
-25
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ To convert back, use the companion object function `Instant.fromEpochMillisecond
175175
### Converting instant and local date/time to and from the ISO 8601 string
176176

177177
`Instant`, `LocalDateTime`, `LocalDate` and `LocalTime` provide shortcuts for
178-
parsing and formatting them using the extended ISO-8601 format.
178+
parsing and formatting them using the extended ISO 8601 format.
179179
The `toString()` function is used to convert the value to a string in that format, and
180180
the `parse` function in companion object is used to parse a string representation back.
181181

@@ -201,7 +201,7 @@ LocalTime.parse("12:0:03.999") // fails with an IllegalArgumentException
201201

202202
### Working with other string formats
203203

204-
When some data needs to be formatted in some format other than ISO-8601, one
204+
When some data needs to be formatted in some format other than ISO 8601, one
205205
can define their own format or use some of the predefined ones:
206206

207207
```kotlin

core/common/src/DateTimePeriod.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public sealed class DateTimePeriod {
9696
totalMonths <= 0 && days <= 0 && totalNanoseconds <= 0 && (totalMonths or days != 0 || totalNanoseconds != 0L)
9797

9898
/**
99-
* Converts this period to the ISO-8601 string representation for durations, for example, `P2M1DT3H`.
99+
* Converts this period to the ISO 8601 string representation for durations, for example, `P2M1DT3H`.
100100
*
101101
* @see DateTimePeriod.parse
102102
*/
@@ -143,12 +143,12 @@ public sealed class DateTimePeriod {
143143

144144
public companion object {
145145
/**
146-
* Parses a ISO-8601 duration string as a [DateTimePeriod].
146+
* Parses a ISO 8601 duration string as a [DateTimePeriod].
147147
* If the time components are absent or equal to zero, returns a [DatePeriod].
148148
*
149149
* Additionally, we support the `W` signifier to represent weeks.
150150
*
151-
* Examples of durations in the ISO-8601 format:
151+
* Examples of durations in the ISO 8601 format:
152152
* - `P1Y40D` is one year and 40 days
153153
* - `-P1DT1H` is minus (one day and one hour)
154154
* - `P1DT-1H` is one day minus one hour
@@ -372,7 +372,7 @@ public class DatePeriod internal constructor(
372372

373373
public companion object {
374374
/**
375-
* Parses the ISO-8601 duration representation as a [DatePeriod], for example, `P1Y2M30D`.
375+
* Parses the ISO 8601 duration representation as a [DatePeriod], for example, `P1Y2M30D`.
376376
*
377377
* This function is equivalent to [DateTimePeriod.parse], but will fail if any of the time components are not
378378
* zero.

core/common/src/DayOfWeek.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ public expect enum class DayOfWeek {
2222
}
2323

2424
/**
25-
* The ISO-8601 number of the given day of the week. Monday is 1, Sunday is 7.
25+
* The ISO 8601 number of the given day of the week. Monday is 1, Sunday is 7.
2626
*/
2727
public val DayOfWeek.isoDayNumber: Int get() = ordinal + 1
2828

2929
/**
30-
* Returns the [DayOfWeek] instance for the given ISO-8601 week day number. Monday is 1, Sunday is 7.
30+
* Returns the [DayOfWeek] instance for the given ISO 8601 week day number. Monday is 1, Sunday is 7.
3131
*/
3232
public fun DayOfWeek(isoDayNumber: Int): DayOfWeek {
3333
require(isoDayNumber in 1..7)

core/common/src/Instant.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public expect class Instant : Comparable<Instant> {
240240
public override operator fun compareTo(other: Instant): Int
241241

242242
/**
243-
* Converts this instant to the ISO-8601 string representation; for example, `2023-01-02T23:40:57.120Z`
243+
* Converts this instant to the ISO 8601 string representation; for example, `2023-01-02T23:40:57.120Z`
244244
*
245245
* The representation uses the UTC-SLS time scale, instead of UTC.
246246
* In practice, this means that leap second handling will not be readjusted to the UTC.

core/common/src/LocalDate.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public expect class LocalDate : Comparable<LocalDate> {
198198
public override fun compareTo(other: LocalDate): Int
199199

200200
/**
201-
* Converts this date to the extended ISO-8601 string representation.
201+
* Converts this date to the extended ISO 8601 string representation.
202202
*
203203
* @see Formats.ISO for the format details.
204204
* @see parse for the dual operation: obtaining [LocalDate] from a string.

core/common/src/LocalTime.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public expect class LocalTime : Comparable<LocalTime> {
262262
public override operator fun compareTo(other: LocalTime): Int
263263

264264
/**
265-
* Converts this time value to the extended ISO-8601 string representation.
265+
* Converts this time value to the extended ISO 8601 string representation.
266266
*
267267
* For readability, if the time represents a round minute (without seconds or fractional seconds),
268268
* the string representation will not include seconds. Also, fractions of seconds will add trailing zeros to

core/common/src/UtcOffset.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public expect class UtcOffset {
156156
}
157157

158158
/**
159-
* Converts this UTC offset to the extended ISO-8601 string representation; for example, `+02:30` or `Z`.
159+
* Converts this UTC offset to the extended ISO 8601 string representation; for example, `+02:30` or `Z`.
160160
*
161161
* @see Formats.ISO for the format details.
162162
* @see parse for the dual operation: obtaining [UtcOffset] from a string.

core/common/src/serializers/DateTimePeriodSerializers.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public object DateTimePeriodComponentSerializer: KSerializer<DateTimePeriod> {
7171
}
7272

7373
/**
74-
* A serializer for [DateTimePeriod] that represents it as an ISO-8601 duration string.
74+
* A serializer for [DateTimePeriod] that represents it as an ISO 8601 duration string.
7575
*
7676
* JSON example: `"P1DT-1H"`
7777
*
@@ -154,7 +154,7 @@ public object DatePeriodComponentSerializer: KSerializer<DatePeriod> {
154154
}
155155

156156
/**
157-
* A serializer for [DatePeriod] that represents it as an ISO-8601 duration string.
157+
* A serializer for [DatePeriod] that represents it as an ISO 8601 duration string.
158158
*
159159
* Deserializes the time components as well, as long as they are zero.
160160
*

core/common/src/serializers/InstantSerializers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import kotlinx.serialization.descriptors.*
1111
import kotlinx.serialization.encoding.*
1212

1313
/**
14-
* A serializer for [Instant] that uses the ISO-8601 representation.
14+
* A serializer for [Instant] that uses the ISO 8601 representation.
1515
*
1616
* JSON example: `"2020-12-09T09:16:56.000124Z"`
1717
*

core/common/src/serializers/LocalDateSerializers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import kotlinx.serialization.descriptors.*
1111
import kotlinx.serialization.encoding.*
1212

1313
/**
14-
* A serializer for [LocalDate] that uses the ISO-8601 representation.
14+
* A serializer for [LocalDate] that uses the ISO 8601 representation.
1515
*
1616
* JSON example: `"2020-01-01"`
1717
*

core/common/src/serializers/LocalDateTimeSerializers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import kotlinx.serialization.descriptors.*
1111
import kotlinx.serialization.encoding.*
1212

1313
/**
14-
* A serializer for [LocalDateTime] that uses the ISO-8601 representation.
14+
* A serializer for [LocalDateTime] that uses the ISO 8601 representation.
1515
*
1616
* JSON example: `"2007-12-31T23:59:01"`
1717
*

core/common/src/serializers/LocalTimeSerializers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import kotlinx.serialization.descriptors.*
1111
import kotlinx.serialization.encoding.*
1212

1313
/**
14-
* A serializer for [LocalTime] that uses the ISO-8601 representation.
14+
* A serializer for [LocalTime] that uses the ISO 8601 representation.
1515
*
1616
* JSON example: `"12:01:03.999"`
1717
*

core/common/src/serializers/TimeZoneSerializers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public object FixedOffsetTimeZoneSerializer: KSerializer<FixedOffsetTimeZone> {
5454
}
5555

5656
/**
57-
* A serializer for [UtcOffset] that uses the extended ISO-8601 representation.
57+
* A serializer for [UtcOffset] that uses the extended ISO 8601 representation.
5858
*
5959
* JSON example: `"+02:00"`
6060
*

serialization/common/test/DateTimePeriodSerializationTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class DateTimePeriodSerializationTest {
117117

118118
@Test
119119
fun testDefaultSerializers() {
120-
// Check that they behave the same as the ISO-8601 serializers
120+
// Check that they behave the same as the ISO 8601 serializers
121121
dateTimePeriodIso8601Serialization(Json.serializersModule.serializer())
122122
datePeriodIso8601Serialization(Json.serializersModule.serializer(), Json.serializersModule.serializer())
123123
}

serialization/common/test/InstantSerializationTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class InstantSerializationTest {
6363

6464
@Test
6565
fun testDefaultSerializers() {
66-
// should be the same as the ISO-8601
66+
// should be the same as the ISO 8601
6767
iso8601Serialization(Json.serializersModule.serializer())
6868
}
69-
}
69+
}

serialization/common/test/LocalDateSerializationTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class LocalDateSerializationTest {
6666

6767
@Test
6868
fun testDefaultSerializers() {
69-
// should be the same as the ISO-8601
69+
// should be the same as the ISO 8601
7070
iso8601Serialization(Json.serializersModule.serializer())
7171
}
7272

serialization/common/test/LocalDateTimeSerializationTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class LocalDateTimeSerializationTest {
7979

8080
@Test
8181
fun testDefaultSerializers() {
82-
// should be the same as the ISO-8601
82+
// should be the same as the ISO 8601
8383
iso8601Serialization(Json.serializersModule.serializer())
8484
}
8585
}

serialization/common/test/LocalTimeSerializationTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class LocalTimeSerializationTest {
6969

7070
@Test
7171
fun testDefaultSerializers() {
72-
// should be the same as the ISO-8601
72+
// should be the same as the ISO 8601
7373
iso8601Serialization(Json.serializersModule.serializer())
7474
}
7575
}

0 commit comments

Comments
 (0)