minor critics corrected

This commit is contained in:
2024-04-26 11:21:50 +02:00
parent 81de0d1a8f
commit 4602eccdf0
5 changed files with 18 additions and 17 deletions

2
ad.go
View File

@@ -73,7 +73,7 @@ func (ad *Ad) Incomplete() bool {
}
func (ad *Ad) CalculateExpire() {
if len(ad.Created) > 0 {
if ad.Created != "" {
ts, err := time.Parse("02.01.2006", ad.Created)
if err == nil {
ad.Expire = ts.AddDate(0, ExpireMonths, ExpireDays).Format("02.01.2006")