Posted at

from と to を指定して java.time.LocalDate の List を作る

More than 1 year has passed since last update.

var を避けるシリーズ.

import java.time.LocalDate

def dates(fromInclusive: LocalDate, toExclusive: LocalDate): Seq[LocalDate] =
Stream.iterate(fromInclusive)(_.plusDays(1)).takeWhile(_.compareTo(toExclusive) < 0)