BugFix: Anzeige words to review, new packages

This commit is contained in:
Your Name 2025-02-27 18:48:36 +01:00
parent 2f16c30dad
commit 308e40ee9c
4 changed files with 50 additions and 4 deletions

View File

@ -130,5 +130,8 @@
}
}
}
},
"cli": {
"analytics": false
}
}

43
package-lock.json generated
View File

@ -33,6 +33,7 @@
"@angular/cli": "^19.1.7",
"@angular/compiler-cli": "^19.1.0",
"@types/jasmine": "~5.1.0",
"concurrently": "^9.1.2",
"jasmine-core": "~5.5.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
@ -7981,6 +7982,48 @@
"devOptional": true,
"license": "MIT"
},
"node_modules/concurrently": {
"version": "9.1.2",
"resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.1.2.tgz",
"integrity": "sha512-H9MWcoPsYddwbOGM6difjVwVZHl63nwMEwDJG/L7VGtuaJhb12h2caPG2tVPWs7emuYix252iGfqOyrz1GczTQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"chalk": "^4.1.2",
"lodash": "^4.17.21",
"rxjs": "^7.8.1",
"shell-quote": "^1.8.1",
"supports-color": "^8.1.1",
"tree-kill": "^1.2.2",
"yargs": "^17.7.2"
},
"bin": {
"conc": "dist/bin/concurrently.js",
"concurrently": "dist/bin/concurrently.js"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/open-cli-tools/concurrently?sponsor=1"
}
},
"node_modules/concurrently/node_modules/supports-color": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"has-flag": "^4.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/supports-color?sponsor=1"
}
},
"node_modules/connect": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz",

View File

@ -4,6 +4,7 @@
"scripts": {
"ng": "ng",
"start": "ng serve --port=4202",
"start-all": "concurrently 'ng serve --port=4202' 'http-server ../vocab-backend'",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
@ -35,6 +36,7 @@
"@angular/cli": "^19.1.7",
"@angular/compiler-cli": "^19.1.0",
"@types/jasmine": "~5.1.0",
"concurrently": "^9.1.2",
"jasmine-core": "~5.5.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",

View File

@ -518,11 +518,9 @@ export class DeckListComponent implements OnInit {
}
// Methode zur Berechnung der Anzahl der zu bearbeitenden Wörter
getWordsToReview(deck: Deck): number {
// const nextTraining = this.getNextTrainingDate(deck);
// return deck.images.flatMap(image => image.boxes.filter(box => (box.due && new Date(box.due * 86400000) <= new Date(nextTraining)) || !box.due)).length;
const nextTraining = this.getNextTrainingDate(deck);
const today = this.getTodayInDays();
return deck.images.flatMap(image => image.boxes.filter(box => (box.due && box.due <= today) || !box.due)).length;
// this.currentImageData.boxes.filter(box => box.due === undefined || box.due <= today);
return deck.images.flatMap(image => image.boxes.map(box => (box.due ? box.due : null))).filter(e=>e===nextTraining).length;
}
getTodayInDays(): number {
const epoch = new Date(1970, 0, 1); // Anki uses UNIX epoch