@Flightkick opened this Issue on September 19th 2018

I'm trying to re-index the visitors geolocations but console command always returns invalid date format.

$ php console usercountry:attribute dates-range=2018-08-22,2018-09-19

  [Exception]
  Date format must be: YYYY-MM-DD, or 'today' or 'yesterday' or any keyword supported by the strtotime function (see http://php.net/strtotime for more information):

usercountry:attribute [--percent-step="..."] [--provider="..."] [--segment-limit[="..."]] [--force] dates-range

I tried the following combinations to no avail (always showing above exception):

php console usercountry:attribute dates-range="2018-08-22,2018-09-19"

php console usercountry:attribute "dates-range=2018-08-22,2018-09-19"

php console usercountry:attribute dates-range=\"2018-08-22,2018-09-19\"

php console usercountry:attribute dates-range=yesterday,today

php console usercountry:attribute dates-range='yesterday','today'

php console usercountry:attribute dates-range=\'yesterday\',\'today\'

php console usercountry:attribute dates-range="'yesterday','today'"

php console usercountry:attribute dates-range=\"'yesterday','today'\"

php console usercountry:attribute dates-range=\"\'yesterday\',\'today\'\"

I found the related function but wasn't able to dig deeper.
https://github.com/matomo-org/matomo/blob/1a76568aa7f85920e8f4b58e0aa2fd32f64de8ad/plugins/UserCountry/Commands/AttributeHistoricalDataWithLocations.php#L163-L175

Additional info:
Matomo-version: 3.6.0
PHP-version: 7.2.9-1+ubuntu16.04.1+deb.sury.org+1

@Flightkick commented on September 19th 2018

I fixed the issue. I stumbled upon the command syntax from here: https://issues.matomo.org/6146

Appearently, i was supposed to omit the date-range= argument and just post the dates:

php console usercountry:attribute 2018-01-01,2019-01-01

Worked.

This Issue was closed on September 19th 2018
Powered by GitHub Issue Mirror