I need to take the data returned from timevis, but these data are returned with one hour less than the data entered. I have tried changing the R time zone and the server too, but that has not solved the problem. here's a simple example of what I'm trying to do:
ui<-fluidPage(
mainPanel(
timevisOutput("gantt"),
tableOutput("return"),
actionButton("btn","btn")
)
)
server <- function(input, output, session) {
data <- data.frame(
id = 1:4,
content = c("Item one" , "Item two" ,"Ranged item", "Item four"),
start = c("2016-01-10 00:00:00", "2016-01-11T00:00:00.000Z", "2016-01-20", "2016-02-14 15:00:00"),
end = c(NA , NA, "2016-02-04", NA),
group =c(1,1,2,2)
)
output$gantt<-renderTimevis({
timevis(data= data,
groups = data.frame(id = 1:4, content = c(" 1", " 2", " 3", " 4")),
options = list(editable = list(add=FALSE, remove=TRUE, updateTime= TRUE, updateGroup=TRUE, overrideItems=TRUE), align = "left"))
})
observeEvent(input$btn,{
output$return<-renderTable(
print(input$gantt_data)
)
})
}
shinyApp(ui, server)
The result of input$gantt_data returned is this:
id content start group end
1 1 Item one 2016-01-09T23:00:00.000Z 1 <NA>
2 2 Item two 2016-01-10T23:00:00.000Z 1 <NA>
3 3 Ranged item 2016-01-19T23:00:00.000Z 2 2016-02-03T23:00:00.000Z
4 4 Item four 2016-02-14T14:00:00.000Z 2 <NA>
