Skip to content

Commit

Permalink
Add more written documentation for pkgdown site
Browse files Browse the repository at this point in the history
  • Loading branch information
ellisvalentiner committed Sep 25, 2017
1 parent 5afb8b7 commit b0cb75f
Show file tree
Hide file tree
Showing 25 changed files with 449 additions and 39 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# lubridateExtras 0.1.0

## 2017-09-24

* Initial release notes
4 changes: 2 additions & 2 deletions R/instants.R
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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
}
8 changes: 8 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

110 changes: 110 additions & 0 deletions docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 112 additions & 0 deletions docs/articles/intro.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b0cb75f

Please sign in to comment.