Given a range, getting all dates within that range in Scala

前端 未结 6 1863
礼貌的吻别
礼貌的吻别 2021-02-04 03:29

I need to make a function in scala that, given a range of dates, gives me a list of the range. I am relatively new in Scala and I am not able to figure out how to write the righ

6条回答
  •  有刺的猬
    2021-02-04 04:00

    val numberOfDays = Days.daysBetween(from, until).getDays()
    for (f<- 0 to numberOfDays) yield from.plusDays(f)
    

提交回复
热议问题