Ubidots Community

[SOLVED]Date Counting since a specific date


I would like to user to input the date (e.g. 5/1/2022) on the dashboard. And I would like to count the days since the input date.

I am thinking to create a widget in dashboard for user to input a date. Use the synthetic value to count the days from user’s input date.

Any suggestion to approach this?


Hello @dongyoun,

Doing such calculation isn’t possible within Ubidots, at least not natively. My suggestion would be to do as follow:

  1. Create a Manual input widget with the the Date fields enabled. Learn more here.
  2. Have the user enter the Date
  3. From an HTML canvas widget, build your own logic so that it receives the date (in timestamp format) entered by the user, and compute the number of days since that date.
    You might want to look a he below article about the HTML canvas widget

Have a good one!