IADate

public class IADate : ModelFieldProtocol

Internet Archive Date field

Parses the following formats:

  • ISO8601 (2018-11-15T08:23:41Z, 2018-11-15T08:23:41-07:00, etc)
  • Date

    Date Time (2018-03-25 14:51:24)

    Date

    Date (2018-09-03)
  • Year (2018)
  • Year Month (2018-09)
  • Approximate Year ([2018])
  • Circa Year (c.a. 2018)
  • Note: The approximate and circa formats do not have a representation that they’re approximate, since the Date type has no way of representing it.

    Example Usage

    let dateField = IADate(fromString: "2018-11-15T08:23:41Z")
    dateField.value => Date "2018-11-15T08:23:41Z"