Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Add an option to get stats from today and yesterday #4

Closed
amq opened this issue Oct 6, 2014 · 3 comments
Closed

Add an option to get stats from today and yesterday #4

amq opened this issue Oct 6, 2014 · 3 comments
Assignees

Comments

@amq
Copy link

amq commented Oct 6, 2014

I couldn't find a proper way to do this.

Currently offered day option produces the same results as:

index.php?module=Counter&action=show&date=2014-10-05&id=1

(it is 2014-10-06 today)

Meaning that it combines stats from ysterday and today.

I want to be able to easily get the today's stats without having to manually specify date=2014-10-06 and also yesterday's (currently not even manually possible as far as I understand).

@Globulopolis
Copy link
Owner

You mean "date range" like in the piwik?

@Globulopolis Globulopolis self-assigned this Oct 6, 2014
@amq
Copy link
Author

amq commented Oct 6, 2014

I just want a counter which would display the number of visitors from the current day. Just like almost every counter-as-a-service does (liveinternet etc)

I can achieve that by using

index.php?module=Counter&action=show&date=2014-10-06&id=1

But I would need some script to keep the correct date.

In other words, I am looking for something like this:

index.php?module=Counter&action=show&date=today&id=1
index.php?module=Counter&action=show&date=yesterday&id=1

@amq
Copy link
Author

amq commented Oct 18, 2014

I think it should be

if ($_date == 'day') {
$date = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y')));
} elseif ($_date == 'yesterday') {
$date = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-1, date('Y')));

instead of

if ($_date == 'day') {
$date = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-1, date('Y')));
} elseif ($_date == 'yesterday') {
$date = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-2, date('Y')));

@Globulopolis Globulopolis reopened this Oct 19, 2014
Globulopolis pushed a commit that referenced this issue Oct 19, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants