diff --git a/OpenBudgeteer.Core/ViewModels/EntityViewModels/BucketViewModel.cs b/OpenBudgeteer.Core/ViewModels/EntityViewModels/BucketViewModel.cs index 960c8b0..6edb591 100644 --- a/OpenBudgeteer.Core/ViewModels/EntityViewModels/BucketViewModel.cs +++ b/OpenBudgeteer.Core/ViewModels/EntityViewModels/BucketViewModel.cs @@ -703,7 +703,12 @@ public ViewModelOperationResult HandleInOutInput() { try { - ServiceManager.BucketService.CreateMovement(BucketId, InOut, _currentYearMonth); + var date = DateTime.Now; + if (_currentYearMonth.Year != date.Year || _currentYearMonth.Month != date.Month) { + var day = (date > _currentYearMonth) ? DateTime.DaysInMonth(_currentYearMonth.Year, _currentYearMonth.Month) : 1; + date = new DateTime(_currentYearMonth.Year, _currentYearMonth.Month, day); + } + ServiceManager.BucketService.CreateMovement(BucketId, InOut, date); CalculateValues(); return new ViewModelOperationResult(true); }