Skip to content

Add a customized localized formatters for DocumentData Duration, Instant, Money types #47

@adrw

Description

@adrw

For example, a DocumentData with a paramter of type Money could include a lambda on how to format that anytime it is rendered removing the need for every DocumentData constructor to format before construction.

data class RecipientReceipt(
  val sender: String,
  @BarberField(fomat = { amount ->
    Money.of(amount).asCasual()
  })
  val amount: Money,
  val cancelUrl: String,
  @BarberField(format = { dateTime -> Instant.of(dateTime).format("YYYY-MM-DD") })
  val deposit_expected_at: Instant
) : DocumentData

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions