Using java.time API in scala

I am trying to use Java 8 Date Time Api java.time using Scala REPL. Just ran into a problem below:

enter image description here

I understand that the with keyword is reserved in scala, but is also used in the API. Any idea on how to reduce the limits?

+6
source share
1 answer

Try wrapping with labels as follows:

 val nextWed = today.`with`(java.time.temporal.TemporalAdjusters.next(DayOfWeek.WEDNESDAY)) 

Adding ticks denotes its literal identifier.

+6
source

All Articles