Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sys.Date() providing date of last server restart #1882

Closed
fedeb95 opened this issue Nov 3, 2017 · 3 comments
Closed

Sys.Date() providing date of last server restart #1882

fedeb95 opened this issue Nov 3, 2017 · 3 comments

Comments

@fedeb95
Copy link

fedeb95 commented Nov 3, 2017

I have a dateRangeInput in ui.R that sets as start and end Sys.Date(). When I start the server the date is correct, but after a day it remains the same, so for the days after, until I restart the server. Am I missign something?

@bborgesr
Copy link
Contributor

bborgesr commented Nov 3, 2017

Your UI is probably not a function, and so it is being cached by Shiny for performance reasons. If you don't want the caching, just make it into a function (however, this does mean that you lose the slight performance benefit of UI caching).

Turn this:

ui <- fluidPage(...)

into this:

ui <- function(req) {
  fluidPage(...)
}

@daattali
Copy link
Contributor

daattali commented Nov 5, 2017

UI caching/using function(req) is another extremely useful feature that almost nobody knows about and can be added to the FAQ :)

@fedeb95
Copy link
Author

fedeb95 commented Nov 6, 2017

Thank you! Using a function solved the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants