diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..b2c22fc --- /dev/null +++ b/NEWS.md @@ -0,0 +1,6 @@ + +# lubridateExtras 0.1.0 + +## 2017-09-24 + +* Initial release notes diff --git a/R/instants.R b/R/instants.R index d67a41f..ac0d75b 100644 --- a/R/instants.R +++ b/R/instants.R @@ -104,7 +104,7 @@ next_month <- function(tzone = "") { #' is.weekend("2017-08-29") # FALSE #' is.weekend("2017-09-02") # TRUE is.weekend <- function(x) { - wday(x = as_date(x), label = FALSE, abbr = FALSE) %in% 6:7 + wday(x = as_date(x), label = FALSE, abbr = FALSE) %in% c(1, 7) } #' Is x a weekday? @@ -118,5 +118,5 @@ is.weekend <- function(x) { #' is.weekend("2017-08-29") # FALSE #' is.weekend("2017-09-02") # TRUE is.weekday <- function(x) { - wday(x = as_date(x), label = FALSE, abbr = FALSE) %in% 1:5 + wday(x = as_date(x), label = FALSE, abbr = FALSE) %in% 2:6 } diff --git a/README.Rmd b/README.Rmd index 47ad105..91daa79 100644 --- a/README.Rmd +++ b/README.Rmd @@ -41,9 +41,17 @@ If you encounter a clear bug, please file a minimal reproducible example on [git ```{r} library(lubridateExtras) +yesterday() + +tomorrow() + days_ago(7) # equivalent to lubridate::today() - lubridate::days(7) days_hence(7) # equivalent to lubridate::today() + lubridate::days(7) ``` +## Why lubridateExtras? + +Some people are probably asking the question: why lubridateExtras? +lubridateExtras does not do anything that you cannot do with lubridate but similarly you don't need lubridate at all to work with date/times in R! If you like the syntactic sugar of lubridateExtras then use it, otherwise stick with what works for you. diff --git a/README.md b/README.md index b6685fb..e4f9fc4 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,22 @@ Usage ``` r library(lubridateExtras) +yesterday() +#> [1] "2017-09-23" + +tomorrow() +#> [1] "2017-09-25" + days_ago(7) # equivalent to lubridate::today() - lubridate::days(7) -#> [1] "2017-09-14" +#> [1] "2017-09-17" days_hence(7) # equivalent to lubridate::today() + lubridate::days(7) -#> [1] "2017-09-28" +#> [1] "2017-10-01" ``` + +Why lubridateExtras? +-------------------- + +Some people are probably asking the question: why lubridateExtras? + +lubridateExtras does not do anything that you cannot do with lubridate but similarly you don't need lubridate at all to work with date/times in R! If you like the syntactic sugar of lubridateExtras then use it, otherwise stick with what works for you. diff --git a/_pkgdown.yml b/_pkgdown.yml index 78fc6b5..87f04d4 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -11,7 +11,7 @@ navbar: type: default left: - text: Intro - href: lubridateExtras.html + href: articles/intro.html - text: Reference href: reference/index.html - text: News diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 5b7bc16..cd44d67 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -52,7 +52,7 @@
diff --git a/docs/news/index.html b/docs/news/index.html new file mode 100644 index 0000000..1007797 --- /dev/null +++ b/docs/news/index.html @@ -0,0 +1,126 @@ + + + + + + + + +