RamiKrispin / coronavirus_dashboard

The Coronavirus Dashboard
https://ramikrispin.github.io/coronavirus_dashboard/
108 stars 133 forks source link

update date in the github page #20

Closed sparklingjourney closed 3 years ago

sparklingjourney commented 3 years ago

Hi RamiKripin, Thank you for the really great work!

I am learning github page and developed a dashboard at https://sparklingjourney.github.io/COVID-Mobility-Dashboard/.

In my codes, the date variable displayed on the dashboard comes from sys.date() as I want it to update every day; however this is not the case. Would you kindly let me know what might be missing?

Thanks! Ayan

RamiKrispin commented 3 years ago

Hi @sparklingjourney sorry for the late response. The date on the dashboard will be set according to the value of sys.date() at the time of the deployment. Once the dashboard is rendered into a static HTML, it won't change. If you want to refresh anything in the dashboard you should either rerender the dashboard each time you have any change or set a cron job. Here is an example of a cron job I am using for this dashboard to refresh the data:

https://github.com/RamiKrispin/coronavirus_dashboard/blob/f0ec640bdffec804b3cfb865956e9c9edbe92fca/.github/workflows/data_refresh.yml#L5