Bump timex from 3.7.1 to 3.7.9 (#5865)

* Bump timex from 3.7.1 to 3.7.9

Bumps [timex](https://github.com/bitwalker/timex) from 3.7.1 to 3.7.9.
- [Release notes](https://github.com/bitwalker/timex/releases)
- [Changelog](https://github.com/bitwalker/timex/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitwalker/timex/compare/3.7.1...3.7.9)

---
updated-dependencies:
- dependency-name: timex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Replace Translator.default_locale() -> Translator.current_locale()

* Fix format_unit/4 function in order to match Timex.Translator.translate_plural\'s n is integer

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Viktor Baranov <baranov.viktor.27@gmail.com>
pull/5909/head
dependabot[bot] 2 years ago committed by GitHub
parent 7caafddcb2
commit 3c92a1f79a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      apps/explorer/lib/explorer/counters/average_block_time_duration_format.ex
  2. 2
      mix.lock

@ -36,7 +36,7 @@ defmodule Explorer.Counters.AverageBlockTimeDurationFormat do
"1.1 minutes"
"""
@spec format(Duration.t()) :: String.t() | {:error, term}
def format(%Duration{} = duration), do: lformat(duration, Translator.default_locale())
def format(%Duration{} = duration), do: lformat(duration, Translator.current_locale())
def format(_), do: {:error, :invalid_duration}
@doc """
@ -88,13 +88,17 @@ defmodule Explorer.Counters.AverageBlockTimeDurationFormat do
truncated = trunc(decimal_value)
# remove any trailing `.0`
formatted_value =
if decimal_value == truncated do
truncated
else
Float.round(decimal_value, 1)
end
Translator.translate_plural(locale, "units", "%{count} #{singular}", "%{count} #{singular}s", formatted_value)
if decimal_value == truncated do
Translator.translate_plural(locale, "units", "%{count} #{singular}", "%{count} #{singular}s", truncated)
else
value =
decimal_value
|> Float.round(1)
|> :erlang.float_to_binary(decimals: 1)
locale
|> Translator.translate_plural("units", "%{count} #{singular}", "%{count} #{singular}s", 5)
|> String.replace("5", value)
end
end
end

@ -123,7 +123,7 @@
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"},
"tesla": {:hex, :tesla, "1.4.4", "bb89aa0c9745190930366f6a2ac612cdf2d0e4d7fff449861baa7875afd797b2", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:finch, "~> 0.3", [hex: :finch, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:gun, "~> 1.3", [hex: :gun, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: true]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "d5503a49f9dec1b287567ea8712d085947e247cb11b06bc54adb05bfde466457"},
"timex": {:hex, :timex, "3.7.1", "1157bd18abf2dcfd61ed666b1f73c356b2e97197deccfecafad188629282fb61", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 1.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "cb5d815666e30625d517360523ddd023eb1b4bc27c564e7501c3d050115df523"},
"timex": {:hex, :timex, "3.7.9", "790cdfc4acfce434e442f98c02ea6d84d0239073bfd668968f82ac63e9a6788d", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 1.1", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "64691582e5bb87130f721fc709acfb70f24405833998fabf35be968984860ce1"},
"toml": {:hex, :toml, "0.6.2", "38f445df384a17e5d382befe30e3489112a48d3ba4c459e543f748c2f25dd4d1", [:mix], [], "hexpm", "d013e45126d74c0c26a38d31f5e8e9b83ea19fc752470feb9a86071ca5a672fa"},
"tzdata": {:hex, :tzdata, "1.1.1", "20c8043476dfda8504952d00adac41c6eda23912278add38edc140ae0c5bcc46", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "a69cec8352eafcd2e198dea28a34113b60fdc6cb57eb5ad65c10292a6ba89787"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},

Loading…
Cancel
Save