I would like to know if there is a way to convert dates ("2020-06-26") in french date ("26-06-2020").
Keeping the as.Date() date format.
I read i can convert with format(x,"%d/%m/%Y")), but results appears in characters.
Problematic in my case cause i would like to filter dates in my shiny app with a renderDT output.
So, my expected result would be to have the following result but in french date.
If i use format(), i lose the slider to define periods in filter (because characters).
I think if your 'locale' is set to France, then this would work.
library(DT)
#example data
x = strptime('2015-07-23 22:05:21', '%Y-%m-%d %H:%M:%S', tz = 'EST')
(x = x + seq(1, 1e6, length.out = 5))
d = data.frame(toLocaleDateString = x )
datatable(d) %>%
formatDate(1,'toLocaleDateString')
# use DT:::DateMethods below to see the possible methods aside from toLocaleDateString