Fixed that meal plan week costs were missing for weeks 1 - 9

This commit is contained in:
Bernd Bestel
2020-01-21 21:54:22 +01:00
parent 22c978c8dc
commit 5793f6b041
2 changed files with 3 additions and 2 deletions

View File

@@ -25,6 +25,7 @@
### Meal plan fixes
- Fixed that when `FEATURE_FLAG_STOCK_PRICE_TRACKING` was set to `false`, prices were still shown (thanks @kriddles)
- Fixed that the week costs were missing for the weeks 1 - 9 of a year
### Calendar improvements
- Improved that meal plan events in the iCal calendar export now contain a link to the appropriate meal plan week in the body of the event (thanks @kriddles)

View File

@@ -31,9 +31,9 @@ var calendar = $("#calendar").fullCalendar({
$(".fc-day-header").append('<a class="ml-1 btn btn-outline-dark btn-xs my-1 add-recipe-button" href="#"><i class="fas fa-plus"></i></a>');
var weekRecipeName = view.start.year().toString() + "-" + (view.start.week() - 1).toString();
var weekRecipeName = view.start.year().toString() + "-" + ((view.start.week() - 1).toString().padStart(2, "0")).toString();
var weekRecipe = FindObjectInArrayByPropertyValue(internalRecipes, "name", weekRecipeName);
var weekCosts = 0;
var weekRecipeOrderMissingButtonHtml = "";
var weekRecipeConsumeButtonHtml = "";