NebulaGraphEx.Types.NebDate (nebula_graph_ex v0.1.10)

Copy Markdown View Source

NebulaGraph date value.

Separate from Elixir's Date to avoid ambiguity — NebulaGraph dates do not carry calendar or timezone metadata. Use to_date/1 to convert to a standard %Date{} when you need Elixir date arithmetic.

Fields

  • :year — calendar year (e.g. 2024)
  • :month1..12
  • :day1..31

Summary

Functions

Converts to a standard %Date{}. Returns {:error, reason} on invalid values.

Converts to a standard %Date{}, raising on invalid values.

Types

t()

@type t() :: %NebulaGraphEx.Types.NebDate{day: 1..31, month: 1..12, year: integer()}

Functions

to_date(neb_date)

@spec to_date(t()) :: {:ok, Date.t()} | {:error, atom()}

Converts to a standard %Date{}. Returns {:error, reason} on invalid values.

to_date!(nd)

@spec to_date!(t()) :: Date.t()

Converts to a standard %Date{}, raising on invalid values.