Display today’s date on dashboard using javascript

Share on facebook
Share on twitter
Share on linkedin
Share on reddit
Share on email

1. Add any box container or the icon that will display the date



2. Next right click and select ‘Data source’



In the connection drop down, select ‘Personal Cloud’ and in the SQL enter the following SQL

select 'dummy' as Today

3. In the javascript window add this following code



//get today's date into the variable

var today = new Date();

/* our SQL will return one data element containing the value "dummy"
in the glb array at the first position determined by [0][0]
so we simply replace the data value with our javascript date value */


4. Click OK

And you will see that the date is formatted in the default javascript format and displayed as below


If you need to display the date in different format then you can use the date functions

For e.g if you just need to display the date part and don’t need the timezone and time part then you can achieve this as below.



SQL Method

Now the above method relied on the javascript to generate the date. But if you work with database then all SQL database provide a date function that you can use to display the current date.

For MySQL, you would use the now() function

select now() as "Today"

For Oracle

select sysdate as "Today' from dual

So find the appropriate database date/time function to display the dates on the dashboard.

Custom Reports and Dashboards

We will build you a set of custom reports and dashboards
Best Offer

The Core Tools

Create dashboard for any Database

Data Visualizer and Dashboard Application
This is the best dashboard software for its price. One good thing we did was to hire their consulting services to build few dashboard prototypes and provide some quick dashboard training.
- Terry Seal, IL
We evaluated Xcelsius and Qlikview and the cost for organization to implement dashboards was quoted over 10,000 USD. For fraction of the above quoted price, we were able to buy the licenses for the web based dashboard software and get some free training. This is truly a dashboard software for small businesses like us.
IT Manager of a Trucking company, OH