R-CoderDotCom / calendR

Ready to print calendars with ggplot2
https://r-coder.com/calendar-plot-r/
MIT License
255 stars 35 forks source link

2018 starts at week 2 #4

Closed patwcollins closed 4 years ago

patwcollins commented 4 years ago

I ran the following code and it starts 2018 at week 2 and runs to week 54.

calendR(
  start_date = "2018-01-01",
  end_date = "2018-12-31",
  lty = 0,
  title = "2018",
  start = "M",
  weeknames = c("M", "T",  # Week names
                "W", "T",
                "F", "S", "S"),
  week.number = TRUE,
  week.number.col = "red")
R-CoderDotCom commented 4 years ago

Hey there, you are right. Thanks for reporting this! There are lots of combinations of arguments and it is difficult to check all of them, This issue seemed to happen when the year starts on Monday. It should be fixed now. I've tried with several combinations of years and everything seems to work. This is the output with your code:

imagen

I'm going to close this issue but feel free to reopen it if something does not work as expected.

R-CoderDotCom commented 4 years ago

Sorry, it is not fixed yet. Now there is an issue in 2012 when week starts on Monday because there are 54 weeks. I will try to fix it.

R-CoderDotCom commented 4 years ago

Code updated again. Please verify if the week.number argument works as expected.

R-CoderDotCom commented 4 years ago

I'm going to close this issue. Feel free to reopen it if the problem persists.