Packages
ex_tempo
0.10.1
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.0
1.3.1
1.3.0
1.2.0
1.1.1
1.1.0
1.0.0
0.21.0
0.20.0
0.19.2
0.19.1
0.19.0
0.18.1
0.18.0
0.17.1
0.17.0
0.16.2
0.16.1
0.16.0
0.15.1
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
0.10.2
0.10.1
0.10.0
0.9.0
0.8.0
0.7.0
0.6.0
0.5.0
0.4.1
0.4.0
0.3.0
0.2.0
Time as an interval, not an instant — ISO 8601 / IXDTF date, time, interval, duration, recurrence, set-algebra, scheduling, and constraint-network library for Elixir. Calendar- and timezone-aware.
Current section
Files
Jump to
Current section
Files
mix.exs
defmodule Tempo.MixProject do
use Mix.Project
@version "0.10.1"
def project do
[
app: :ex_tempo,
version: @version,
name: "Tempo",
source_url: "https://github.com/kipcole9/tempo",
docs: docs(),
deps: deps(),
description: description(),
package: package(),
elixir: "~> 1.17",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
dialyzer: [
flags: [
:error_handling,
:unknown,
:underspecs,
:extra_return,
:missing_return
]
]
]
end
def description do
"Time as an interval, not an instant — ISO 8601 and IXDTF-compliant " <>
"date, time, interval, duration, recurrence, and set-algebra library " <>
"for Elixir. Calendar- and timezone-aware."
end
def package do
[
maintainers: ["Kip Cole"],
licenses: ["Apache-2.0"],
links: links(),
files: [
"lib",
"mix.exs",
"README*",
"CHANGELOG*",
"LICENSE*",
"assets/logo.png"
]
]
end
def links do
%{
"GitHub" => "https://github.com/kipcole9/tempo",
"Readme" => "https://github.com/kipcole9/tempo/blob/v#{@version}/README.md",
"Changelog" => "https://github.com/kipcole9/tempo/blob/v#{@version}/CHANGELOG.md"
}
end
def docs do
[
source_ref: "v#{@version}",
main: "readme",
logo: "assets/logo.png",
# Copy the project's `assets/` directory into the generated
# docs' `assets/` subdirectory so images referenced from README
# (and guides) resolve. Without this, ``
# renders as a broken image in local `mix docs` output and on
# hexdocs.pm.
assets: %{"assets" => "assets"},
extras:
[
"README.md",
"LICENSE.md",
"CHANGELOG.md"
] ++ Path.wildcard("guides/*.md"),
formatters: ["html", "markdown"],
groups_for_modules: groups_for_modules(),
groups_for_extras: groups_for_extras(),
skip_undefined_reference_warnings_on:
[
"CHANGELOG.md"
] ++ Path.wildcard("guides/*.md")
]
end
def groups_for_modules do
[
Core: ~r/^Tempo(?:\.(Interval|IntervalSet|Duration|Range|Set))?$/,
"Clock and current time": ~r/^Tempo\.Clock(\.|$)/,
"Set algebra and comparison":
~r/^Tempo\.(Operations|Compare|Math|Rounding|Split|Select|Mask|Territory)$/,
"Recurrence (RRULE)": ~r/^Tempo\.RRule(\.|$)/,
"iCalendar integration": ~r/^Tempo\.ICal(\.|$)/,
"ISO 8601 and IXDTF": ~r/^Tempo\.Iso8601(\.|$)/,
Enumeration: ~r/^Tempo\.Enumeration$|^Enumerable\.Tempo/,
"Explanation and inspection":
~r/^Tempo\.(Explain|Explanation|Inspect|Format|Sigil|Validation)$/,
Visualizer: ~r/^Tempo\.Visualizer(\.|$)/,
Exceptions: ~r/^Tempo\.\w+Error$/
]
end
defp groups_for_extras do
[
Cookbooks: [
"guides/cookbook.md",
"guides/scheduling.md",
"guides/workdays-and-weekends.md",
"guides/holidays.md"
],
Guides: [
"guides/when-to-use-tempo.md",
"guides/interop.md",
"guides/set-operations.md",
"guides/enumeration-semantics.md",
"guides/pattern-matching-with-sigils.md",
"guides/ical-integration.md",
"guides/falsehoods.md"
],
Reference: [
"guides/iso8601-conformance.md",
"guides/rfc5545_rrule_conformance.md",
"guides/shared-ast-iso8601-and-rrule.md"
],
Foundations: [
"guides/temporal-formalisms.md"
]
]
end
def application do
[
extra_applications: [:logger, :inets, :tzdata, :localize]
]
end
defp deps do
[
{:nimble_parsec, "~> 1.0"},
{:calendrical, "~> 0.9 or ~> 1.0"},
{:astro, "~> 2.2"},
{:localize, "~> 0.21"},
{:tzdata, "~> 1.1"},
{:ical, "~> 2.0", optional: true},
{:plug, "~> 1.15", optional: true},
{:bandit, "~> 1.5", optional: true},
{:ex_doc, "~> 0.38", only: [:dev, :test, :release], optional: true, runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:stream_data, "~> 1.0", only: [:dev, :test], runtime: false},
# `tz` provides a `Calendar.TimeZoneDatabase` implementation used
# only in dev/test so iCal 2.0 can resolve `DTSTART;TZID=...`
# properties and Tempo examples can round-trip zoned values.
# Runtime consumers supply their own zone DB (e.g. `:tzdata`,
# which Tempo already depends on).
{:tz, "~> 0.28", only: [:dev, :test]}
] ++ maybe_json_polyfill()
end
defp maybe_json_polyfill do
if Code.ensure_loaded?(:json) do
[]
else
[{:json_polyfill, "~> 0.2 or ~> 1.0"}]
end
end
defp elixirc_paths(:test), do: ["lib", "mix", "test", "test/support"]
defp elixirc_paths(:dev), do: ["lib", "mix", "bench"]
defp elixirc_paths(_), do: ["lib"]
end