Fixtures v0.0.1 Fixtures.Time View Source

Time and date related generators.

Link to this section Summary

Functions

Generate a random date of birth up to a 100 years old.

Generate a random date of birth up to a 100 years old.

Generate a random timestamp.

Generate a random timestamp.

Link to this section Functions

Link to this function

date_of_birth(opts \\ [])

View Source
date_of_birth(Keyword.t()) :: Date.t()

Generate a random date of birth up to a 100 years old.

Options

  • :age the following value formats are accepted:

    • from..to a date of birth for someone with an age between from and to. (inclusive)
    • integer a date of birth for someone with the given age.
  • :from
  • :to
Link to this function

date_of_birth(settings, key, opts \\ [])

View Source
date_of_birth(Keyword.t(), atom(), Keyword.t()) :: Date.t()

Generate a random date of birth up to a 100 years old.

Options

  • :age the following value formats are accepted:

    • from..to a date of birth for someone with an age between from and to. (inclusive)
    • integer a date of birth for someone with the given age.
  • :from
  • :to

Generate a random timestamp.

Link to this function

timestamp(settings, key, opts \\ [])

View Source
timestamp(Keyword.t(), atom(), Keyword.t()) :: DateTime.t() | NaiveDateTime.t()

Generate a random timestamp.