@@ -16,10 +16,8 @@ ANY_VERSION <- "999.99.99"
1616
1717plan(mirai_multisession )
1818
19- source(" get_usage.R"  )
20- source(" connect_module.R"  )
21- source(" version_ordering.R"  )
22- source(" supported_versions.R"  )
19+ files.sources  =  list.files(" R"  , full.names  =  TRUE )
20+ sapply(files.sources , source )
2321
2422options(
2523  spinner.type  =  1 ,
@@ -48,6 +46,11 @@ app_mode_lookup <- with(
4846  setNames(as.character(ind ), values )
4947)
5048
49+ to_iso8601  <-  function (x ) {
50+   strftime(x , " %Y-%m-%dT%H:%M:%S%z"  ) | > 
51+     sub(" ([+-]\\ d{2})(\\ d{2})$"  , " \\ 1:\\ 2"  , x  =  _)
52+ }
53+ 
5154#  Shiny app definition
5255
5356ui  <-  page_sidebar(
@@ -400,7 +403,15 @@ server <- function(input, output, session) {
400403
401404  usage_task  <-  ExtendedTask $ new(function (window_days ) {
402405    future({
403-       get_usage(client , from  =  today() -  days(window_days ), to  =  today()) | > 
406+       from  <-  as.POSIXct(
407+         paste(today() -  days(window_days ), " 00:00:00"  ),
408+         tz  =  " " 
409+       )
410+       to  <-  as.POSIXct(paste(today(), " 00:00:00"  ), tz  =  " "  )
411+ 
412+       usage_list  <-  get_usage(client , from  =  from , to  =  to )
413+       as_tibble(usage_list ) | > 
414+         select(content_guid ) | > 
404415        group_by(content_guid ) | > 
405416        summarize(views  =  n(), .groups  =  " drop"  )
406417    })
0 commit comments