@@ -82,7 +82,9 @@ get_column_def <- function(name, field, value) {
82
82
if (is.null(attr(value , " class" ))) {
83
83
filter <- " agNumberColumnFilter"
84
84
}
85
- } else if (inherits(value , " Date" )) {
85
+ } else if (inherits(value , " Date" )
86
+ || inherits(value , " POSIXlt" )
87
+ || inherits(value , " POSIXct" )) {
86
88
type <- " dateColumn"
87
89
filter <- " agDateColumnFilter"
88
90
} else if (is.logical(value )) {
@@ -181,7 +183,9 @@ dataview_table <- local({
181
183
if (! is.null(fd $ type ) && ! is.null(fd $ filter )) {
182
184
op <- fd $ type
183
185
raw <- if (fd $ filterType == " date" ) fd $ dateFrom else fd $ filter
184
- lit <- if (inherits(dt1 [[col_name ]], " Date" )) {
186
+ lit <- if (inherits(dt1 [[col_name ]], " Date" )
187
+ || inherits(dt1 [[col_name ]], " POSIXlt" )
188
+ || inherits(dt1 [[col_name ]], " POSIXct" )) {
185
189
sprintf(' as.Date("%s")' , raw )
186
190
} else if (is.numeric(dt1 [[col_name ]])) {
187
191
as.numeric(raw )
@@ -205,7 +209,10 @@ dataview_table <- local({
205
209
blank = sprintf(' is.na(%s) | %s == ""' , col_name , col_name ),
206
210
notBlank = sprintf(' !is.na(%s) & %s != ""' , col_name , col_name ),
207
211
inRange = {
208
- hi <- if (inherits(dt1 [[col_name ]], " Date" ) && ! is.null(fd $ dateTo )) {
212
+ hi <- if ((inherits(dt1 [[col_name ]], " Date" )
213
+ || inherits(dt1 [[col_name ]], " POSIXlt" )
214
+ || inherits(dt1 [[col_name ]], " POSIXct" ))
215
+ && ! is.null(fd $ dateTo )) {
209
216
sprintf(' as.Date("%s")' , fd $ dateTo )
210
217
} else {
211
218
as.numeric(fd $ filterTo )
0 commit comments