Skip to content

Commit a99bfc0

Browse files
committed
also return editors inactive_days as int column
1 parent 553ab31 commit a99bfc0

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: dashboard
22
Title: What the Package Does (One Line, Title Case)
3-
Version: 0.0.1.003
3+
Version: 0.0.1.004
44
Authors@R:
55
person(given = "First",
66
family = "Last",

R/editors.R

+9-7
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ editor_status <- function (quiet = FALSE) {
126126
dat$status <- "FREE"
127127
dat$status [dat$state == "OPEN"] <- "BUSY"
128128

129-
dat$inactive_for <- get_elapsed_time (dat$updated_at)
129+
dtime <- get_elapsed_time (dat$updated_at)
130+
dat$inactive_days <- dtime$dtime_days
131+
dat$inactive_for <- dtime$dtime
130132

131133
# Suppress no visible binding notes:\
132134
stats <- status <- updated_at <- editor <- state <- inactive_for <-
@@ -148,12 +150,12 @@ get_elapsed_time <- function (tvec) {
148150

149151
d0 <- lubridate::ymd_hms (Sys.time ())
150152
d1 <- lubridate::ymd_hms (tvec)
151-
dtime <- as.numeric (lubridate::interval (d1, d0)) / (24 * 3600) # in days
152-
dtime [dtime < 1] <- 1 # Mimimum 1 day
153+
dtime_days <- as.numeric (lubridate::interval (d1, d0)) / (24 * 3600)
154+
dtime_days [dtime_days < 1] <- 1 # Mimimum 1 day
153155
dtime <- cbind (
154-
round (dtime),
155-
round (dtime * 52 / 365),
156-
round (dtime * 12 / 365)
156+
round (dtime_days),
157+
round (dtime_days * 52 / 365),
158+
round (dtime_days * 12 / 365)
157159
)
158160
dtime [is.na (dtime)] <- 1 # just to suppress NA warnings; removed below
159161

@@ -170,5 +172,5 @@ get_elapsed_time <- function (tvec) {
170172
dtime <- paste0 (dtime, " ", units)
171173
dtime [which (is.na (d1))] <- NA
172174

173-
return (dtime)
175+
return (list (dtime_days = round (dtime_days), dtime = dtime))
174176
}

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"name": "dashboard: What the Package Does (One Line, Title Case)",
77
"codeRepository": "https://github.com/ropensci-review-tools/dashboard",
88
"license": "https://spdx.org/licenses/MIT",
9-
"version": "0.0.1.003",
9+
"version": "0.0.1.004",
1010
"programmingLanguage": {
1111
"@type": "ComputerLanguage",
1212
"name": "R",

0 commit comments

Comments
 (0)