Skip to content

Commit

Permalink
Fixed nit
Browse files Browse the repository at this point in the history
  • Loading branch information
hohonuuli committed Jul 5, 2024
1 parent 35c0b57 commit b30443a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions scommons/src/main/scala/org/mbari/scommons/util/ISO8601.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ import org.mbari.scommons.etc.jdk.Instants
@deprecated("Use org.mbari.scommons.Instants instead", "0.0.7")
object ISO8601:


def parseIso8601(s: String): Either[Throwable, Instant] =
Instants.parseIso8601(s) match
case Some(i) => Right(i)
case None => Left(new IllegalArgumentException(s"Could not parse $s as an ISO8601 timestamp"))


/**
* Parse a string in common ISO8601 formats into an Instant
* @param timestamp
* @return
*/
def parse(timestamp: String): Option[Instant] = Instants.parseIso8601(timestamp)
/**
* Parse a string in common ISO8601 formats into an Instant
* @param timestamp
* @return
*/
def parse(timestamp: String): Option[Instant] = Instants.parseIso8601(timestamp)

0 comments on commit b30443a

Please sign in to comment.