Skip to content

Commit

Permalink
Merge pull request #113 from AlterTobi/dev
Browse files Browse the repository at this point in the history
merge dev into main
  • Loading branch information
AlterTobi authored Nov 4, 2024
2 parents 72586a5 + 96a5507 commit 3397152
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions no_support/wfes-editChallengeCounter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @name Edit Challenge Counter
// @version 1.0.2
// @version 1.0.3
// @description Count Edit Contributions for the 2024 Wayfarer Edit Challenge
// @author AlterTobi

Expand Down Expand Up @@ -45,11 +45,11 @@
});

// Zählprozess
const startDate = new Date(START_DATE);
const endDate = new Date(END_DATE);
contributions.forEach(item => {
// Vergleiche Datum und Typ des Objekts
const itemDate = new Date(item.day);
const startDate = new Date(START_DATE);
const endDate = new Date(END_DATE);

if (itemDate >= startDate && itemDate <= endDate && TYPES.includes(item.type)) {
counts[item.type]++;
Expand Down Expand Up @@ -96,14 +96,14 @@
const contributions = window.wfes.g.nominationsList();

const result = countContributions(contributions);
const resultSum = result.PHOTO + result.EDIT_TITLE + result.EDIT_DESCRIPTION + result.EDIT_LOCATION;
let resultSum = 0;
TYPES.forEach(type => {
resultSum += result[type];
});
const resulttext = " (P" + result.PHOTO + " T" + result.EDIT_TITLE +
" D" + result.EDIT_DESCRIPTION + " L" + result.EDIT_LOCATION + ")";

createButton("2024 Edit Challenge", resulttext, resultSum);

// YOUR CODE HERE
// .catch((e) => {console.warn(GM_info.script.name, ": ", e);});
}

const init = () => {
Expand Down

0 comments on commit 3397152

Please sign in to comment.