forked from bitwalker/timex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.exs
117 lines (95 loc) · 3.47 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
defmodule Timex.Mixfile do
use Mix.Project
def project do
[ app: :timex,
version: "2.1.4",
elixir: "~> 1.1",
description: description,
package: package,
deps: deps,
docs: docs,
compilers: [:gettext] ++ Mix.compilers,
test_coverage: [tool: ExCoveralls] ]
end
def application do
[applications: [:logger, :tzdata, :gettext, :combine],
env: [local_timezone: nil, default_locale: "en"]]
end
defp description do
"""
A comprehensive date/time library for Elixir
Fully timezone-aware, using the Olson Timezone database
- Supports local-timezone lookups
- Supports POSIX-style timezones
- Supports lookups of any Olson tzdata timezones
- Supports arbitrary shifts across time and through timezones,
including ambiguous time periods, non-existent time periods, and leaps.
Provides both Date and DateTime types, for use depending on your needs,
with an AmbiguousDateTime type for handling those DateTime values which fall on
an ambigouos timezone period.
Extendable via Convertable and Comparable protocols, so you can use Timex with
your own types!
Locale-aware, currently only supports "ru" and "en", but more will be added over time.
Provides a broad array of date/time helper functions
- shifting/adding/subtracting
- diffing
- comparing/before?/after?/between?
- conversions
- get day of week, week of year, ISO dates, and names for each
- get the beginning or ending of a given week
- get the beginning or ending of a year, quarter, week, or month
- get days in a given month
- normalization
Provides a broad array of time-specific helpers
- convert to and from units: weeks, days, hours, seconds, ms, and microseconds
- measure execution time
- diff/compare
- to/from 12/24 hour clock times
- add/subtract
Safe date/time string formatting and parsing
- Informative parser errors
- Supports strftime, as well as an easier to read formatter, i.e. `{ISO:Basic}`, `{YYYY}`
- Supports many formats out of the box: ISO8601 basic and extended, RFC822, RFC1123, RFC3339, ANSIC, UNIX
- Relative time formatter (i.e. "2 years from now")
Extendable
- Protocols for core modules like the parser tokenizer
- Easy to wrap to add extra functionality
Can be used with Phoenix and Ecto when used with timex_ecto package
"""
end
defp package do
[ files: ["lib", "priv", "mix.exs", "README.md", "LICENSE.md"],
maintainers: ["Paul Schoenfelder"],
licenses: ["MIT"],
links: %{ "GitHub": "https://github.com/bitwalker/timex" } ]
end
def deps do
[{:tzdata, "~> 0.1.8 or ~> 0.5"},
{:combine, "~> 0.7"},
{:gettext, "~> 0.10"},
{:ex_doc, "~> 0.11", only: :dev},
{:earmark, "~> 0.2", only: :dev},
{:benchfella, "~> 0.3", only: :dev},
{:dialyze, "~> 0.2", only: :dev},
{:excoveralls, "~> 0.4", only: [:dev, :test]},
{:inch_ex, "~> 0.4", only: [:dev, :test]}]
end
defp docs do
[main: "getting-started",
formatter_opts: [gfm: true],
extras: [
"docs/Getting Started.md",
"CHANGELOG.md",
"docs/Basic Usage.md",
"docs/Erlang Interop.md",
"docs/Working with DateTime.md",
"docs/Working with Time.md",
"docs/Formatting.md",
"docs/Parsing.md",
"docs/FAQ.md",
"docs/Using with Ecto.md",
"docs/Custom Parsers.md",
"docs/Custom Formatters.md"
]]
end
end