Skip to content

Commit

Permalink
fix errors, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trafficonese committed Apr 13, 2022
1 parent 1a941f9 commit e556cf5
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 141 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
^docs$
^pkgdown$
^trials$
^bower_components$
^appveyor\.yml$
^CRAN-RELEASE$
^cran-comments\.md$
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

export(perioddaterangeOptions)
export(perioddaterangepicker)
export(updateDaterangepicker)
importFrom(htmltools,"htmlDependencies<-")
importFrom(htmltools,htmlDependencies)
importFrom(htmltools,htmlDependency)
Expand Down
90 changes: 44 additions & 46 deletions R/daterangepicker.R
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@


#' updateDaterangepicker
#'
#' Change the start and end values of a daterangepicker on the client
#'
#' @param session The session object passed to function given to shinyServer.
#' @inheritParams daterangepicker
#' @family daterangepicker Functions
#' @export
updateDaterangepicker <- function(session, inputId, label = NULL,
start = NULL, end = NULL,
min = NULL, max = NULL,
icon = NULL, options = NULL,
ranges = NULL, style = NULL,
class = NULL) {

## If no icon was passed initially, we need to create a WebDependency-list
## On the JS-side `Shiny.renderDependencies` adds the deps to the header
if (!is.null(icon)) {
icon$htmldeps <- list(shiny::createWebDependency(
htmltools::resolveDependencies(
htmltools::htmlDependencies(
icon
)
)[[1]]
))
}

message <- filterEMPTY(list(
id = session$ns(inputId),
label = label,
start = start,
end = end,
minDate = min,
maxDate = max,
icon = icon,
options = options,
ranges = ranges,
style = style,
class = class
))

session$sendInputMessage(inputId, message)
}

# updateDaterangepicker
#
# Change the start and end values of a daterangepicker on the client
#
# @param session The session object passed to function given to shinyServer.
# @inheritParams daterangepicker
# @family daterangepicker Functions
# @export
# updateDaterangepicker <- function(session, inputId, label = NULL,
# start = NULL, end = NULL,
# min = NULL, max = NULL,
# icon = NULL, options = NULL,
# ranges = NULL, style = NULL,
# class = NULL) {
#
# ## If no icon was passed initially, we need to create a WebDependency-list
# ## On the JS-side `Shiny.renderDependencies` adds the deps to the header
# if (!is.null(icon)) {
# icon$htmldeps <- list(shiny::createWebDependency(
# htmltools::resolveDependencies(
# htmltools::htmlDependencies(
# icon
# )
# )[[1]]
# ))
# }
#
# message <- filterEMPTY(list(
# id = session$ns(inputId),
# label = label,
# start = start,
# end = end,
# minDate = min,
# maxDate = max,
# icon = icon,
# options = options,
# ranges = ranges,
# style = style,
# class = class
# ))
#
# session$sendInputMessage(inputId, message)
# }
#



Expand Down Expand Up @@ -193,7 +193,6 @@ perioddaterangeOptions <- function(period = c("day","week","month","quarter","ye
anchorElement = NULL,
parentElement = NULL,
forceUpdate = FALSE,
timezone = "utc",
locale = list(
applyButtonTitle = "Apply",
cancelButtonTitle = "Cancel",
Expand Down Expand Up @@ -228,7 +227,6 @@ perioddaterangeOptions <- function(period = c("day","week","month","quarter","ye
anchorElement = anchorElement,
parentElement = parentElement,
forceUpdate = forceUpdate,
timeZone = timezone,
locale = locale
))
}
Expand Down
1 change: 0 additions & 1 deletion man/perioddaterangeOptions.Rd

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

28 changes: 0 additions & 28 deletions man/updateDaterangepicker.Rd

This file was deleted.

4 changes: 2 additions & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library(testthat)
library(daterangepicker)
library(perioddaterangepicker)

test_check("daterangepicker")
test_check("perioddaterangepicker")
Loading

0 comments on commit e556cf5

Please sign in to comment.