# `FrappeUIPhx.Duration`
[🔗](https://github.com/moacirbishopcamata/frappe_ui_phx/blob/v0.3.1/lib/frappe_ui_phx/duration.ex#L1)

Duração em segundos ⇄ texto digitado (`1h 30m`, `90m`, `45s`, `1:30`, `1:30:15`, `5400`).

Núcleo puro compartilhado pelo componente `duration` e pelo tipo
`FrappeUIPhx.Ecto.Duration`, para que tela e domínio nunca divirjam.

# `display`

```elixir
@spec display(term()) :: String.t()
```

Valor de campo (segundos, texto digitado ou nil) → texto para exibir no controle.

# `humanize`

```elixir
@spec humanize(non_neg_integer() | nil) :: String.t()
```

Segundos → `"1h 30m 15s"` (`"0s"` para zero, `""` para `nil`).

# `parse`

```elixir
@spec parse(term()) :: {:ok, non_neg_integer() | nil} | :error
```

Texto → `{:ok, segundos | nil}` ou `:error`. Vazio vira `nil`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
