How To: Fix "Custom Date Range" view in Open Web Analytics 1.4.1

by Jonathan 1. November 2011 07:48

If you're a user of Open Web Analytics version 1.4.1, you may notice that if you try to set your report period to a custom date range, it instead shows you the statistics for "11/30/1999 - 11/30/1999".  From my reading, this should be fixed in version 1.5.0, but until that is released, we can backport the fix, provided here http://trac.openwebanalytics.com/changeset/1413 into 1.4.1.

To do so, first backup the file owa.report.js, which is in the modules/base/js/ directory of your OWA installation.  Now, you can apply the patch given at that link, or manually apply it by opening owa.report.js in a text editor and removing the following lines (51-53):

if (this.properties.startDate != null && this.properties.endDate != null) {
    this.setPeriod('date_range');
    }

Additionally, delete the following lines (originally 209-211, but that changed after the first deletion):

OWA.items[reportname].setPeriod('date_range');
// toggle the drop down to custom data range label
jQuery("#owa_reportPeriodFilter option:contains('Custom Date Range')").attr("selected", true);

Now save the file.

Note that this will not completely resolve the issue, as the time period setting is still a bit off.  For example, if your time period is set to "Last Seven Days", and you then use the date boxes to set a custom date range, the custom date range will take effect, but the drop-down menu for time period will still say "Last Seven Days", and not the custom date range.  To work around this, I suggest first setting your time period to "Date Range" (from the drop-down list), which will immediately set your date range to 11/30/1999, as it did before (the above patch does not resolve that, hopefully it will be fixed in the future), and then use the date boxes to set a custom date range.  In this way, your first tell OWA to use a custom date range as its time period, and then you set a custom date range as its date range.  By doing this, the time period drop-down menu should clearly report the current date range that you are viewing.

Tags: , ,

HowTo

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

About Me

My name is Jonathan.  I will try to post useful info here.

Month List