@@ -82,7 +82,9 @@ get_column_def <- function(name, field, value) {
8282 if (is.null(attr(value , " class" ))) {
8383 filter <- " agNumberColumnFilter"
8484 }
85- } else if (inherits(value , " Date" )) {
85+ } else if (inherits(value , " Date" )
86+ || inherits(value , " POSIXlt" )
87+ || inherits(value , " POSIXct" )) {
8688 type <- " dateColumn"
8789 filter <- " agDateColumnFilter"
8890 } else if (is.logical(value )) {
@@ -181,7 +183,9 @@ dataview_table <- local({
181183 if (! is.null(fd $ type ) && ! is.null(fd $ filter )) {
182184 op <- fd $ type
183185 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" )) {
185189 sprintf(' as.Date("%s")' , raw )
186190 } else if (is.numeric(dt1 [[col_name ]])) {
187191 as.numeric(raw )
@@ -205,7 +209,10 @@ dataview_table <- local({
205209 blank = sprintf(' is.na(%s) | %s == ""' , col_name , col_name ),
206210 notBlank = sprintf(' !is.na(%s) & %s != ""' , col_name , col_name ),
207211 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 )) {
209216 sprintf(' as.Date("%s")' , fd $ dateTo )
210217 } else {
211218 as.numeric(fd $ filterTo )
0 commit comments