https://github.com/nathanhornby/emojiclock-elixir
An Elixir module for returning an emoji clock for a given hour
https://github.com/nathanhornby/emojiclock-elixir
clock elixir emoji time
Last synced: 16 days ago
JSON representation
An Elixir module for returning an emoji clock for a given hour
- Host: GitHub
- URL: https://github.com/nathanhornby/emojiclock-elixir
- Owner: nathanhornby
- License: mit
- Created: 2017-04-06T18:56:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T18:53:16.000Z (11 months ago)
- Last Synced: 2025-03-20T07:44:26.649Z (26 days ago)
- Topics: clock, elixir, emoji, time
- Language: Elixir
- Homepage:
- Size: 16.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - An Elixir module for giving you an emoji clock for a given hour. (Date and Time)
- fucking-awesome-elixir - emojiclock - An Elixir module for giving you an emoji clock for a given hour. (Date and Time)
- awesome-elixir - emojiclock - An Elixir module for giving you an emoji clock for a given hour. (Date and Time)
README
# EmojiClock
[](https://github.com/nathanhornby/emojiclock-elixir) [](https://hex.pm/packages/emojiclock)
[](https://hexdocs.pm/emojiclock/readme.html)An Elixir module for giving you an emoji clock for a given hour. See the [API reference](https://hexdocs.pm/emojiclock/EmojiClock.html) for the many available input formats.
```elixir
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`:
```elixir
def deps do
[{:emojiclock, "~> 2.0.2"}]
end
```And then added as an extra application, also in `mix.exs`:
```elixir
def application do
[extra_applications: [:emojiclock]]
end
```## Using EmojiClock
- [API reference](https://hexdocs.pm/emojiclock/EmojiClock.html)
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.
```elixir
iex> EmojiClock.unix(475359803)
{:ok, "🕗"}iex> EmojiClock.unix!(475359803)
"🕗"
```