Last Build Time
I'm trying to grab the last build time to display the duration since last build in days/hours.
But I can't seem to find the correct date in the objects available to me.
widget.on('ready', function(se, ev){
var lastbuildtime = se.datasource.lastBuildTime;
}
This build time isn't correct. It returns the last date I manually built the cube, and does not update on scheduled builds, which seems very strange.
-
Hi Mike,
The most accurate way to retrieve an ElastiCube's last build time is via the REST API call:
http://localhost:8081/api/elasticubes/servers/LocalHost/YourCubeNameHere/lastBuildTime
Which you can execute using jQuery's $.get() shorthand function. (or any other method of executing AJAX calls you prefer)
It will return a serialized date/tick string, like this one: "\/Date(1485199620844)\/"
You can parse it using this code:
// assuming responseData = "\/Date(1485199620844)\/"
var date = new Date(parseInt(responseData.replace('/Date(','').replace(')/',''), 10));Hope this helps!
Please sign in to leave a comment.
Comments
2 comments