This repository has been archived by the owner on Dec 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Add an option to get stats from today and yesterday #4
Labels
Comments
You mean "date range" like in the piwik? |
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
But I would need some script to keep the correct date. In other words, I am looking for something like this:
|
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'))); |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I couldn't find a proper way to do this.
Currently offered day option produces the same results as:
(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).
The text was updated successfully, but these errors were encountered: