Population v0.1.0 Population.Helpers.DateFormat

This module defines some helper functions to format Date related data.

Summary

Functions

Converts a given offset of the form {year, month, day}, {year, month} or {year} to a string in the form "#{year}y#{month}m#{day}d", "#{year}y#{month}m" or #{year}y respectively

Functions

format_date_offset(arg)
format_date_offset(Population.Types.offset) :: String.t

Converts a given offset of the form {year, month, day}, {year, month} or {year} to a string in the form "#{year}y#{month}m#{day}d", "#{year}y#{month}m" or #{year}y respectively.

Examples

iex> Population.Helpers.DateFormat.format_date_offset({2, 5, 30})
"2y5m30d"
iex> Population.Helpers.DateFormat.format_date_offset({2, 5})
"2y5m"
iex> Population.Helpers.DateFormat.format_date_offset({2})
"2y"