mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-02-16 11:50:58 +01:00
Extend statistics over the whole time range (#1626)
This commit is contained in:
parent
c3a821c32a
commit
e04c723de5
@ -23,6 +23,7 @@
|
||||
<option value="week" data-i18n-content="labelPastWeek">Past week</option>
|
||||
<option value="month" data-i18n-content="labelPastMonth">Past month</option>
|
||||
<option value="year" data-i18n-content="labelPastYear">Past year</option>
|
||||
<option value="all" data-i18n-content="labelAll">All</option>
|
||||
</select>
|
||||
<div id="btn-delete" class="button" data-i18n-content="labelDelete">Delete</div>
|
||||
</div>
|
||||
|
@ -127,6 +127,8 @@ statistics._setDateRange = function () {
|
||||
days = 30;
|
||||
} else if (type === 'year') {
|
||||
days = 365;
|
||||
} else if (type === 'all') {
|
||||
days = statistics._daysSinceFirstRelease();
|
||||
} else {
|
||||
statistics._dateRange = [new Date().toISOString().slice(0, 10)];
|
||||
}
|
||||
@ -238,7 +240,7 @@ statistics._displayNameOfFramework = function (str, type) {
|
||||
|
||||
statistics._handlerDateRange = function ({target}) {
|
||||
let type = target.value;
|
||||
if (type === 'day' || type === 'week' || type === 'month' || type === 'year') {
|
||||
if (type === 'day' || type === 'week' || type === 'month' || type === 'year' || type === 'all') {
|
||||
statistics._dateUnit = type;
|
||||
statistics._saveDefaultRange(type);
|
||||
} else if (type === 'delete') {
|
||||
@ -270,6 +272,14 @@ statistics._registerListener = function () {
|
||||
});
|
||||
};
|
||||
|
||||
statistics._daysSinceFirstRelease = function () {
|
||||
let timeDifference, millisecondsPerDay;
|
||||
|
||||
timeDifference = new Date() - new Date('2020-01-01');
|
||||
millisecondsPerDay = 24 * 60 * 60 * 1000;
|
||||
return Math.floor(timeDifference / millisecondsPerDay);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
|
@ -32,6 +32,7 @@
|
||||
<p>Improved</p>
|
||||
<ul>
|
||||
<li>Wildcard support extended in all lists (<a href="https://codeberg.org/nobody/LocalCDN/issues/1622">#1622</a>)</li>
|
||||
<li>Extend statistics over the whole time range (<a href="https://codeberg.org/nobody/LocalCDN/issues/1626">#1626</a>)</li>
|
||||
</ul>
|
||||
<p>Fixed</p>
|
||||
<ul>
|
||||
|
Loading…
x
Reference in New Issue
Block a user