Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First month of downloads in last year graph missing data #20

Open
drn05r opened this issue Jul 27, 2021 · 0 comments
Open

First month of downloads in last year graph missing data #20

drn05r opened this issue Jul 27, 2021 · 0 comments
Labels
Milestone

Comments

@drn05r
Copy link

drn05r commented Jul 27, 2021

The first month of a downloads per month in the last year graph gradually decreases over the month. This is because the date range get renormalised to a year by the Utils::normalise_dates function because the range is not unset when the from date is moved back. I used the following patch to fix this:

Index: lib/plugins/EPrints/Plugin/Stats/View/Google/Graph.pm
===================================================================
--- lib/plugins/EPrints/Plugin/Stats/View/Google/Graph.pm   (revision 16388)
+++ lib/plugins/EPrints/Plugin/Stats/View/Google/Graph.pm   (working copy)
@@ -52,7 +52,7 @@
                if( defined $from && $from =~ /^(\d{4})(\d{2})(\d{2})$/ )
                {
                        $from = $1.$2.'01';
-                       $self->context->dates( { from => $from } );
+                       $self->context->dates( { from => $from, range => undef } );
                }
        }
        elsif( $self->options->{date_resolution} eq 'year' )
@@ -60,7 +60,7 @@
                if( $from =~ /^(\d{4})(\d{2})(\d{2})$/ )
                {
                        $from = $1.'0101';
-                       $self->context->dates( { from => $from } );
+                       $self->context->dates( { from => $from, range => undef } );
                }
        }
@drn05r drn05r added the bug label Jul 27, 2021
@jesusbagpuss jesusbagpuss added this to the 1.2 milestone May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants