alonsodomin / cron4s

Cross-platform CRON expression parsing for Scala
https://alonsodomin.github.io/cron4s
Apache License 2.0
120 stars 24 forks source link

Wrong DateTime with "59 59 23 30 4 *" #72

Closed graingert closed 7 years ago

graingert commented 7 years ago
      val oldDate = new DateTime("2016-09-04T00:00:00.000Z", DateTimeZone.UTC)
      val expected = new DateTime("2017-04-30T23:59:59.000Z", DateTimeZone.UTC)
      val expr = Cron("59 59 23 30 4 *").right.get
      expr.next(oldDate) ==== Some(expected)

but I get

new DateTime("2016-05-01T23:59:59.000Z", DateTimeZone.UTC)
graingert commented 7 years ago

ah woops should be "59 59 23 30 4 ?" which is supported in 0.4