fixed wallet not displaying next month correctly

This commit is contained in:
Fran Jurmanović
2021-07-05 20:39:26 +02:00
parent 29bcbb6e91
commit 1228925881
2 changed files with 27 additions and 7 deletions

View File

@@ -77,11 +77,11 @@ func (as *SubscriptionService) SubToTrans(subModel *models.Subscription, tx *pg.
currentLocation := now.Location()
firstOfNextMonth := time.Date(currentYear, currentMonth+1, 1, 0, 0, 0, 0, currentLocation)
tzFirstOfNextMonth := firstOfNextMonth.In(subModel.StartDate.Location())
//tzFirstOfNextMonth := firstOfNextMonth.In(subModel.StartDate.Location())
startDate := subModel.StartDate
stopDate := tzFirstOfNextMonth
if subModel.HasEnd && subModel.EndDate.Before(tzFirstOfNextMonth) {
stopDate := firstOfNextMonth
if subModel.HasEnd && subModel.EndDate.Before(firstOfNextMonth) {
stopDate = subModel.EndDate
}