TL;DR: When running my R shiny app online, the dates are sorted correctly. When deploying the same app to shinyapps.io, the sorting of the date gets messed up. I have compared package versions between my local and online R instance, and they seem to be identical. Why are the two instances different?
Data ordering is done by creating a separate factor. Specifically, it was performed as follows:
df_sorted$Date <- factor(df_sorted$Date, levels = unique(df_sorted$Date), ordered = T)
I then create a boxplot with the following code (snippet shown):
ggplot(df_sorted, aes(x = Date, y = Hours_total, fill = State)) +
geom_boxplot(outlier.shape = NA) +
coord_cartesian(ylim = c(0, 2500))
Here is the resulting plot on my local computer (correct sorting!):

Here is the same plot on shinyapps.io (incorrect sorting!):
The last 4 entries are clearly incorrectly sorted, the rest is equal.
What I tried already, without any success:
- Archiving the app
- Deleting the app
- Disabling the Package Cache
Any help is greatly appreciated!