Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 8 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 (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T18:53:16.000Z (6 months ago)
- Last Synced: 2024-10-29T08:41:40.311Z (10 days ago)
- Topics: clock, elixir, emoji, time
- Language: Elixir
- Homepage:
- Size: 16.6 KB
- Stars: 3
- Watchers: 2
- 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
[![Elixir](https://img.shields.io/badge/github-elixir-A468BF.svg?style=flat-square)](https://github.com/nathanhornby/emojiclock-elixir) [![Hex.pm](https://img.shields.io/hexpm/v/emojiclock.svg?style=flat-square)](https://hex.pm/packages/emojiclock)
[![Hexdocs](https://img.shields.io/badge/docs-hexdocs-717B94.svg?style=flat-square)](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)
"🕗"
```