Skip to content

Commit

Permalink
Make FixedTimeZone isbits (#354)
Browse files Browse the repository at this point in the history
Co-authored-by: Curtis Vogt <[email protected]>
  • Loading branch information
Wynand and omus authored Oct 12, 2021
1 parent 6eb9788 commit 2b2324f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "1.6.0"
[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
InlineStrings = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
Mocking = "78c3b35d-d492-501b-9361-3d52fe80e533"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Expand All @@ -16,6 +17,7 @@ Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[compat]
Downloads = "1"
InlineStrings = "1.0"
LazyArtifacts = "1.3"
Mocking = "0.7"
RecipesBase = "0.7, 0.8, 1"
Expand Down
1 change: 1 addition & 0 deletions src/TimeZones.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using Printf
using Serialization
using RecipesBase: RecipesBase, @recipe
using Unicode
using InlineStrings: InlineString15

import Dates: TimeZone, UTC

Expand Down
3 changes: 2 additions & 1 deletion src/types/fixedtimezone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const FIXED_TIME_ZONE_REGEX = r"""
A `TimeZone` with a constant offset for all of time.
"""
struct FixedTimeZone <: TimeZone
name::String
name::InlineString15
offset::UTCOffset
end

Expand Down Expand Up @@ -95,3 +95,4 @@ end

name(tz::FixedTimeZone) = tz.name
rename(tz::FixedTimeZone, name::AbstractString) = FixedTimeZone(name, tz.offset)

2 changes: 2 additions & 0 deletions test/types/fixedtimezone.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@testset "FixedTimeZone" begin
@test isbitstype(FixedTimeZone)

@test FixedTimeZone("0123") == FixedTimeZone("UTC+01:23", 4980)
@test FixedTimeZone("+0123") == FixedTimeZone("UTC+01:23", 4980)
@test FixedTimeZone("-0123") == FixedTimeZone("UTC-01:23", -4980)
Expand Down

2 comments on commit 2b2324f

@omus
Copy link
Member

@omus omus commented on 2b2324f Oct 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/46693

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.6.0 -m "<description of version>" 2b2324f655137614788d41646ccb0db6044d3864
git push origin v1.6.0

Please sign in to comment.