day set to one before

This commit is contained in:
Arvind Tiwari 2017-09-30 18:10:34 +05:30
parent 1f09bab3e4
commit df93dfe047

View file

@ -178,5 +178,5 @@ class VMDetail(models.Model):
def end_date(self): def end_date(self):
end_date = self.terminated_at if self.terminated_at else timezone.now() end_date = self.terminated_at if self.terminated_at else timezone.now()
months = relativedelta(end_date, self.created_at).months or 1 months = relativedelta(end_date, self.created_at).months or 1
end_date = self.created_at + relativedelta(months=months) end_date = self.created_at + relativedelta(months=months, days=-1)
return end_date return end_date