mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 06:08:16 +00:00
fixed wallet not displaying next month correctly
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user