Support » Plugin: MarketPress Statistics » months duplicated

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Majklas

    (@majklas)

    I now see what’s wrong:

    You’re counting months with your custom query function backwards:

    <?php echo date("M",strtotime("-1 Months")) ?>
    <?php echo date("M",strtotime("-0 Months")) ?>

    and get this result (from source viewer in js function):

    function drawChart() {
                var data = google.visualization.arrayToDataTable([
                  ['Month', 'Total'],
                  ['Jul', 0],
                  ['Aug', 0],
                  ['Oct', 0],
                  ['Oct', 0],
                  ['Dec', 0],
                  ['Dec', 0],
                  ['Jan', 0],
                  ['Mar', 0],
                  ['Mar', 0],
                  ['May', 0],
                  ['May', 0],
                  ['Jul', 50.34],
                  ['Jul', 50.34]
                ]);

    Thread Starter Majklas

    (@majklas)

    I’ve got answers, but cannot modify your plugin:
    http://derickrethans.nl/obtaining-the-next-month-in-php.html

    Plugin Author Ari Stathopoulos

    (@aristath)

    This issue only occurs on the last day of months that have 31 days. It is a known PHP issue…
    If you wish to contribute to this plugin you can simply fork it on github and then commit a pull request with your improvents: https://github.com/aristath/MarketPress-Statistics

    P.S. I know it needs a complete rewrite… I just haven’t had the time to do it yet. 🙂

    Thread Starter Majklas

    (@majklas)

    Well, I’ve read on php.net about strtotime and they state it is not a bug, just we need a different function for that.
    Today I see everything is fine with the charts 🙂

    Plugin Author Ari Stathopoulos

    (@aristath)

    yeah… I need to completely rewrite the plugin to offer custom reports and fix some minor things like this one.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘months duplicated’ is closed to new replies.