Skip to content

Commit

Permalink
Store correct date of bucket movement
Browse files Browse the repository at this point in the history
fixes #240
  • Loading branch information
Lucaber authored and TheAxelander committed May 25, 2024
1 parent 6897292 commit 3c36c64
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 3c36c64

Please sign in to comment.