From 22230a00af1c4fc36fd25c3935f5eacafc19df4f Mon Sep 17 00:00:00 2001 From: "Kian Meng, Ang" Date: Thu, 23 Dec 2021 23:01:24 +0800 Subject: [PATCH] Fix typos (#684) --- lib/datetime/ambiguous.ex | 4 ++-- lib/datetime/datetime.ex | 2 +- lib/parse/zoneinfo/parser.ex | 2 +- lib/timex.ex | 2 +- lib/timezone/local.ex | 2 +- lib/timezone/posix_timezone.ex | 2 +- test/conversion_test.exs | 2 +- test/timex_test.exs | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/datetime/ambiguous.ex b/lib/datetime/ambiguous.ex index a2182510..5a34163b 100644 --- a/lib/datetime/ambiguous.ex +++ b/lib/datetime/ambiguous.ex @@ -12,7 +12,7 @@ defmodule Timex.AmbiguousDateTime do to -5 from UTC. Since there is no timezone period associated with the hours of 2-3 AM in the America/Chicago zone (it's neither CST nor CDT during that hour), one has to decide what the intent is. Timex makes the call that shifting to the - next period (i.e. "spring foward" using our example above) makes the most logical + next period (i.e. "spring forward" using our example above) makes the most logical sense when working with non-existent time periods. TL;DR - Timex will "spring forward" or "fall back", depending on what the zone change @@ -26,7 +26,7 @@ defmodule Timex.AmbiguousDateTime do This one is the reason why this module exists. There are times, though rare, where more than one zone applies to a given date and time. For example, Asia/Taipei, on December 31st, 1895, from 23:54:00 to 23:59:59, two timezone periods are active LMT, and JWST, because that - locale was switching to JWST from LMT. Because of this, it's impossible to know programmaticaly + locale was switching to JWST from LMT. Because of this, it's impossible to know programmatically which zone is desired. The programmer must make a choice on which zone they want to use. For this use case, Timex will return an AmbiguousDateTime any time you try to create a DateTime, diff --git a/lib/datetime/datetime.ex b/lib/datetime/datetime.ex index a4201efc..25cb8e9e 100644 --- a/lib/datetime/datetime.ex +++ b/lib/datetime/datetime.ex @@ -3,7 +3,7 @@ defimpl Timex.Protocol, for: DateTime do A type which represents a date and time with timezone information (optional, UTC will be assumed for date/times with no timezone information provided). - Functions that produce time intervals use UNIX epoch (or simly Epoch) as the + Functions that produce time intervals use UNIX epoch (or simply Epoch) as the default reference date. Epoch is defined as UTC midnight of January 1, 1970. Time intervals in this module don't account for leap seconds. diff --git a/lib/parse/zoneinfo/parser.ex b/lib/parse/zoneinfo/parser.ex index 51f8d3a8..2f0ff036 100644 --- a/lib/parse/zoneinfo/parser.ex +++ b/lib/parse/zoneinfo/parser.ex @@ -7,7 +7,7 @@ defmodule Timex.Parse.ZoneInfo.Parser do # See https://tools.ietf.org/id/draft-murchison-tzdist-tzif-00.html for details defmodule Zone do @moduledoc """ - Represents the data retreived from a binary tzfile. + Represents the data retrieved from a binary tzfile. """ # Maximum version encountered defstruct version: nil, diff --git a/lib/timex.ex b/lib/timex.ex index 28f92222..58dd4466 100644 --- a/lib/timex.ex +++ b/lib/timex.ex @@ -1679,7 +1679,7 @@ defmodule Timex do @doc """ Return a boolean indicating whether the given year is a leap year. You may - pase a date or a year number. + pass a date or a year number. ## Examples diff --git a/lib/timezone/local.ex b/lib/timezone/local.ex index f1dfed21..57422f11 100644 --- a/lib/timezone/local.ex +++ b/lib/timezone/local.ex @@ -298,7 +298,7 @@ defmodule Timex.Timezone.Local do @doc """ Given a binary representing the data from a tzfile (not the source version), - parses out the timezone for the curent date/time in UTC. + parses out the timezone for the current date/time in UTC. """ @spec parse_tzfile(binary) :: {:ok, String.t()} | {:error, term} def parse_tzfile(tzdata) do diff --git a/lib/timezone/posix_timezone.ex b/lib/timezone/posix_timezone.ex index 83c9cc14..5b2a3ec4 100644 --- a/lib/timezone/posix_timezone.ex +++ b/lib/timezone/posix_timezone.ex @@ -157,7 +157,7 @@ defmodule Timex.PosixTimezone do date = if ldom > day do - # Last occurrance is in week 4, so shift back a week + # Last occurrence is in week 4, so shift back a week %{first_week_date | day: day - 7} else %{first_week_date | day: day} diff --git a/test/conversion_test.exs b/test/conversion_test.exs index fbed6d83..0958baff 100644 --- a/test/conversion_test.exs +++ b/test/conversion_test.exs @@ -218,7 +218,7 @@ defmodule ConversionTests do assert datetime == @default_utc_datetime end - test "map with unparseable string int value" do + test "map with unparsable string int value" do datetime = @default_map |> Map.put("minute", "") diff --git a/test/timex_test.exs b/test/timex_test.exs index 0420eda4..0941775e 100644 --- a/test/timex_test.exs +++ b/test/timex_test.exs @@ -570,7 +570,7 @@ defmodule TimexTests do Timex.diff(~T[12:00:00], ~T[12:00:00], :dayz) end - test "month diff is asymetrical for months of different lengths" do + test "month diff is asymmetrical for months of different lengths" do assert Timex.diff(~D[2017-02-28], ~D[2017-01-27], :months) === 1 assert Timex.diff(~D[2017-02-28], ~D[2017-01-28], :months) === 1 assert Timex.diff(~D[2017-02-28], ~D[2017-01-29], :months) === 0