Skip to content

Commit f9d0dcf

Browse files
paldayomus
andauthored
move RecipesBase support to an extension on 1.9+ (#446)
* move RecipesBase support to an extension on 1.9+ --------- Co-authored-by: Curtis Vogt <[email protected]>
1 parent 77c9c04 commit f9d0dcf

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

Project.toml

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TimeZones"
22
uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53"
33
authors = ["Curtis Vogt <[email protected]>"]
4-
version = "1.12.0"
4+
version = "1.13.0"
55

66
[deps]
77
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
@@ -26,8 +26,15 @@ TZJData = "1"
2626
julia = "1.6"
2727
p7zip_jll = "17.4"
2828

29+
[extensions]
30+
TimeZonesRecipesBaseExt = "RecipesBase"
31+
2932
[extras]
33+
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
3034
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3135

3236
[targets]
33-
test = ["Test"]
37+
test = ["Test", "RecipesBase"]
38+
39+
[weakdeps]
40+
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"

src/plotting.jl ext/TimeZonesRecipesBaseExt.jl

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
module TimeZonesRecipesBaseExt
2+
3+
using TimeZones
4+
using RecipesBase: RecipesBase, @recipe
5+
16
#==
27
Plot ZonedDateTime, on x-axis.
38
We convert it to DateTimes, in the local timezone,
@@ -22,3 +27,5 @@ for details on the options and their tradeoffs.
2227
[], ys
2328
end
2429
end
30+
31+
end # module

src/TimeZones.jl

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module TimeZones
33
using Dates
44
using Printf
55
using Scratch: @get_scratch!
6-
using RecipesBase: RecipesBase, @recipe
76
using Unicode
87
using InlineStrings: InlineString15
98
using TZJData: TZJData
@@ -92,7 +91,11 @@ include("ranges.jl")
9291
include("discovery.jl")
9392
include("rounding.jl")
9493
include("parse.jl")
95-
include("plotting.jl")
9694
include("deprecated.jl")
9795

96+
# Required to support Julia `VERSION < v"1.9"`
97+
if !isdefined(Base, :get_extension)
98+
include("../ext/TimeZonesRecipesBaseExt.jl")
99+
end
100+
98101
end # module

0 commit comments

Comments
 (0)