Skip to content

Commit

Permalink
Document excel_numeric_to_date changes for release
Browse files Browse the repository at this point in the history
  • Loading branch information
sfirke committed Jul 17, 2018
1 parent 9659993 commit 7227b0c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# janitor 1.1
# janitor 1.1 (2018-07-17)

This release was requested by CRAN to address some minor package dependency issues. It also contains several updates and additions described below.

Expand All @@ -12,7 +12,9 @@ The new function `row_to_names` handles the case where a dirty data file is read

## Breaking changes

As part of `excel_numeric_to_date()` now handling times, if a Date-only result is requested (the default) any fractional part of the date is now removed. The date itself is identical, but the underlying object now contains only the integer part of the date. For example, while under both the old and new versions of this function the call `excel_numeric_to_date_old(42001.1)` would return the Date object `"2014-12-28"`, calling `as.numeric` on this result would previously return `16432.1`, while now it returns `16432`.
As part of `excel_numeric_to_date()` now handling times, if a Date-only result is requested (the default behavior of `include_time = FALSE`), any fractional part of the date is now removed. The printed date itself is identical, but the internal representation of this object now contains only the integer part of the date. For example, while under both the old and new versions of this function the call `excel_numeric_to_date_old(42001.1)` would return the Date object `"2014-12-28"`, calling `as.numeric` on this Date result would previously return `16432.1`, while now it returns `16432`.

This an improved behavior, as now `excel_numeric_to_date(42001.1, include_time = FALSE) == as.Date("2014-12-28")` returns TRUE, while previously it would appear to be equivalent from the printed value but this comparison would return FALSE.

# janitor 1.0.0 (2018-03-17)

Expand Down
3 changes: 2 additions & 1 deletion R/excel_dates.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#' excel_numeric_to_date(40000.5) # No time is included
#' excel_numeric_to_date(40000.5, include_time = TRUE) # Time is included
#' excel_numeric_to_date(40000.521, include_time = TRUE) # Time is included
#' excel_numeric_to_date(40000.521, include_time = TRUE, round_seconds = FALSE) # Time with fractional seconds is included
#' excel_numeric_to_date(40000.521, include_time = TRUE,
#' round_seconds = FALSE) # Time with fractional seconds is included

# Converts a numeric value like 42414 into a date "2016-02-14"

Expand Down
7 changes: 4 additions & 3 deletions man/excel_numeric_to_date.Rd

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

0 comments on commit 7227b0c

Please sign in to comment.