Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
BirtDateTime called from an included javascript file
Migrateduser
<p>Hello,</p>
<p> </p>
<p>I'm struggling with upgrading my reports from birt 2.3.2 to 4.3.1. (Maximo 7.1 to Maximo 7.6).</p>
<p> </p>
<p>I use an external javascript file for utilities and one function calls BirtDateTime.addHour. When calling it, try/catch doesn't work and the initialize event exits with a null.</p>
<p> </p>
<p>Does anyone faced a similar issue before? My colleague has the same issue with BirtComp.</p>
<p> </p>
<p>Thanks for helping me out.</p>
<p> </p>
<p>Eric</p>
<pre class="_prettyXprint _lang-js">
function changeTimeZone(d, dateTz, targetTz){
var dateTzOffset, targetTzOffset;
try{
// get Date TimeZone offset in Hours
dateTzOffset = dateTz.getOffset( d.getTime() ) / (3600000);
// get Target TimZone Offset in Hours
targetTzOffset = targetTz.getOffset( d.getTime() ) / (3600000);
return BirtDateTime.addHour(d, (dateTzOffset - targetTzOffset) * -1);
}
catch(e){
logger.error("btlib - error converting timezone: " + e.message);
return null;
}
}
</pre>
Find more posts tagged with
Comments
There are no comments yet