Skip to content

Commit

Permalink
Add a TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
dkhalanskyjb committed May 13, 2024
1 parent 07c5a56 commit 94a2e0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/commonJs/src/Instant.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public actual class Instant internal constructor(internal val value: jtInstant)
if (epochMilliseconds > 0) MAX else MIN
}

// TODO: implement a custom parser to 1) help DCE get rid of the formatting machinery 2) move Instant to stdlib
public actual fun parse(input: CharSequence, format: DateTimeFormat<DateTimeComponents>): Instant = try {
// This format is not supported properly by Joda-Time, so we can't delegate to it.
format.parse(input).toInstantUsingOffset()
Expand Down
1 change: 1 addition & 0 deletions core/jvm/src/Instant.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public actual class Instant internal constructor(internal val value: jtInstant)
* optional minutes and seconds and `:` between them:
* https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatterBuilder.html#appendOffset-java.lang.String-java.lang.String-
*/
// TODO: implement a custom parser to 1) help DCE get rid of the formatting machinery 2) move Instant to stdlib
format.parse(input).toInstantUsingOffset()
} catch (e: IllegalArgumentException) {
throw DateTimeFormatException("Failed to parse an instant from '$input'", e)
Expand Down

0 comments on commit 94a2e0d

Please sign in to comment.