Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support printing weeks and quarters #194

Closed
wants to merge 1 commit into from

Conversation

LilithHafner
Copy link

Before

julia> string(AnchoredInterval{Week(1)}(floor(today(), Week)))
ERROR: MethodError: no method matching prefix(::Type{Week})
Closest candidates are:
  prefix(::Period) at ~/.julia/dev/Intervals/src/description.jl:58
  prefix(::Type{Year}) at ~/.julia/dev/Intervals/src/description.jl:62
  prefix(::Type{Month}) at ~/.julia/dev/Intervals/src/description.jl:63
  ...
Stacktrace:
 [1] prefix(p::Week)
   @ Intervals ~/.julia/dev/Intervals/src/description.jl:59
 [2] description(dt::Date, p::Week, suffix::String)
   @ Intervals ~/.julia/dev/Intervals/src/description.jl:22
 [3] description(interval::AnchoredInterval{Week(1), Date, Closed, Open}, s::String)
   @ Intervals ~/.julia/dev/Intervals/src/description.jl:4
 [4] description(i::AnchoredInterval{Week(1), Date, Closed, Open})
   @ Intervals ~/.julia/dev/Intervals/src/description.jl:1
 [5] print(io::IOBuffer, interval::AnchoredInterval{Week(1), Date, Closed, Open})
   @ Intervals ~/.julia/dev/Intervals/src/anchoredinterval.jl:256
 [6] print_to_string(xs::AnchoredInterval{Week(1), Date, Closed, Open})
   @ Base ./strings/io.jl:144
 [7] string(xs::AnchoredInterval{Week(1), Date, Closed, Open})
   @ Base ./strings/io.jl:185
 [8] top-level scope
   @ REPL[26]:1

After

julia> string(AnchoredInterval{Week(1)}(floor(today(), Week)))
"[WB 2022-06-06)"

@LilithHafner LilithHafner requested a review from omus as a code owner June 10, 2022 15:19
@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #194 (b4b1994) into master (cb4f4d5) will decrease coverage by 0.26%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #194      +/-   ##
==========================================
- Coverage   81.73%   81.46%   -0.27%     
==========================================
  Files          11       11              
  Lines         624      626       +2     
==========================================
  Hits          510      510              
- Misses        114      116       +2     
Impacted Files Coverage Δ
src/description.jl 94.87% <0.00%> (-5.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb4f4d5...b4b1994. Read the comment docs.

@LilithHafner
Copy link
Author

Duplicate of #164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant