Skip to content

Incorrect date returned for sufficiently old dates #23

Description

@jackheslop96

Passing a date of LocalDate(1840, 12, 1) returns 30 November 1840 using the following code. I believe the date is correctly parsing from a java.time.LocalDate to an org.joda.time.LocalDate.

import org.joda.time.{LocalDate => JodaDate}
import java.time.{LocalDate => JavaDate}

def formatDate(date: JavaDate)(implicit messages: Messages): Html = {
  val convertedDate: JodaDate = new JodaDate(date.getYear, date.getMonthValue, date.getDayOfMonth)
  val formattedDate: String = languageUtils.Dates.formatDate(convertedDate)
  HtmlFormat.escape(formattedDate)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions