Skip to content

Commit

Permalink
Merge pull request #1067 from yadavan88/date-module-migration
Browse files Browse the repository at this point in the history
Migrated scala-core-date to scala 3
  • Loading branch information
lor6 authored Dec 13, 2023
2 parents 078e50f + c59da78 commit 969f02d
Show file tree
Hide file tree
Showing 16 changed files with 5 additions and 24 deletions.
1 change: 0 additions & 1 deletion scala-core-modules/scala-core-8/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
- [The Either Type in Scala](https://www.baeldung.com/scala/either-type)
- [Understanding the Differences: reduceLeft, reduceRight, foldLeft, foldRight, scanLeft, and scanRight in Scala](https://www.baeldung.com/scala/reduce-fold-scan-left-right)
- [Different Ways to Reverse a Sequence in Scala](https://www.baeldung.com/scala/reverse-sequence)
- [Generate List of Dates Between a Range in Scala](https://www.baeldung.com/scala/date-range-list)
1 change: 1 addition & 0 deletions scala-core-modules/scala-core-dates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ This module contains articles about Scala's date features.
- [Get Difference Between Two Dates](https://www.baeldung.com/scala/difference-between-two-dates)
- [Convert Epoch Milliseconds to DateTime in Scala](https://www.baeldung.com/scala/epoch-milliseconds-datetime)
- [Convert a String to Date in Scala](https://www.baeldung.com/scala/string-to-date)
- [Generate List of Dates Between a Range in Scala](https://www.baeldung.com/scala/date-range-list)
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.baeldung.scala.datesandtimes
import java.text.SimpleDateFormat
import scala.concurrent.duration.Duration
import scala.concurrent.{Await, Future}
import scala.concurrent.{Await, ExecutionContext, Future}

object JavaUtilDate extends App {

implicit val ec = scala.concurrent.ExecutionContext.Implicits.global
implicit val ec: ExecutionContext =
scala.concurrent.ExecutionContext.Implicits.global

val format: ThreadLocal[SimpleDateFormat] =
new ThreadLocal[SimpleDateFormat] {
Expand All @@ -31,5 +32,5 @@ object JavaUtilDate extends App {
val date1 = Await.result(r1, Duration.Inf)
val date2 = Await.result(r2, Duration.Inf)

println(date1 + ", " + date2) // Prints "Wed Jul 01 2020, Fri Aug 21 2020"
println(s"$date1, $date2") // Prints "Wed Jul 01 2020, Fri Aug 21 2020"
}

This file was deleted.

0 comments on commit 969f02d

Please sign in to comment.