更改时间和日期格式以在闪亮的仪表板上显示正确的格式 [英] Changing time and dateformat to show correct format on shiny dashboard

查看:150
本文介绍了更改时间和日期格式以在闪亮的仪表板上显示正确的格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用多个日期和时间列构建了该仪表板,但是在仪表板中,显示屏关于如何删除它的任何想法?我尝试了 as.character as.factor 任何时间但我无法实现。

I've build this dashboard with multiple date and time columns however in the dashboard the "T" and "Z" popup in the display Any ideas on how to remove this? I tried as.character, as.factor, anytime but I'm not able to make it happen.

还有其他想法!

推荐答案

在您从R转到Java脚本时会发生您需要添加

 output$yourDT <- DT::renderDataTable({
     DT::datatable(df) %>% formatDate(3, "toLocaleString")
 })

其中3代表位置您正在格式化的日期(例如,POSIXct(),而不是因数)列(例如,第三列)。

Where the 3 represents the position of the date (as.POSIXct(), not factor, for example) column (e.g., third column) you are formatting.

这篇关于更改时间和日期格式以在闪亮的仪表板上显示正确的格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆