diff --git a/angular.json b/angular.json index f818fa6..73ce09f 100644 --- a/angular.json +++ b/angular.json @@ -130,5 +130,8 @@ } } } + }, + "cli": { + "analytics": false } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index bc1093a..45e7c4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 75e2308..e467261 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/app/deck-list.component.ts b/src/app/deck-list.component.ts index ac53329..b72412a 100644 --- a/src/app/deck-list.component.ts +++ b/src/app/deck-list.component.ts @@ -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