Skip to content

Commit

Permalink
add accessors for Day and higher
Browse files Browse the repository at this point in the history
  • Loading branch information
amsingh17 committed Sep 23, 2024
1 parent cea9813 commit 7bfd2ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/accessors.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Dates: Hour, Minute, Second, Millisecond, days, hour, minute, second, millisecond
using Dates: Quarter, Year, Month, Day, Hour, Minute, Second, Millisecond, days, hour, minute, second, millisecond

"""
timezone(::ZonedDateTime) -> TimeZone
Expand All @@ -9,7 +9,7 @@ timezone(zdt::ZonedDateTime) = zdt.timezone

Dates.days(zdt::ZonedDateTime) = days(DateTime(zdt))

for period in (:Hour, :Minute, :Second, :Millisecond)
for period in (:Quarter, :Year, :Month, :Day, :Hour, :Minute, :Second, :Millisecond)
accessor = Symbol(lowercase(string(period)))
@eval begin
Dates.$accessor(zdt::ZonedDateTime) = $accessor(DateTime(zdt))
Expand Down

0 comments on commit 7bfd2ad

Please sign in to comment.