Home

Awesome

EmojiClock

Elixir Hex.pm Hexdocs

An Elixir module for giving you an emoji clock for a given hour. See the API reference for the many available input formats.

iex> EmojiClock.time!(~T[02:17:47.179])
"🕑"

Installing EmojiClock

The package can be installed by adding emojiclock to your list of dependencies in mix.exs:

def deps do
  [{:emojiclock, "~> 2.0.2"}]
end

And then added as an extra application, also in mix.exs:

def application do
  [extra_applications: [:emojiclock]]
end

Using EmojiClock

The EmojiClock module has several functions, all of which return an emoji clock bitstring. Every function that accepts an argument has a ! variant, which should be used if you trust your input and want to get straight to the emoji.

iex> EmojiClock.unix(475359803)
{:ok, "🕗"}

iex> EmojiClock.unix!(475359803)
"🕗"