func (VS *Server) auditPerDayToHTML(c *gin.Context, a [][]Audit) []AuditDayHTML {
	var aDay AuditDayHTML
	var auditDay []AuditDayHTML
	// previousDayAudit := a[i][0].Date.Date()
	if a == nil {
		return auditDay
	}
	if len(a) == 0 {
		return auditDay
	}
	for i := 0; i < len(a); i++ {
		aDay = (AuditDayHTML{})
		if len(a[i]) > 0 {
			y, m, d := time.Unix(a[i][0].Date, 0).Date()
			aDay.Date = time.Unix(a[i][0].Date, 0).Weekday().String() + ", " + strconv.Itoa(d) + " of " + m.String() + " of " + strconv.Itoa(y)
		}
		for j := 0; j < len(a[i]); j++ {
			if a[i][j].Description == Created {
				aDay.Created = append(aDay.Created, VS.auditToAuditHTML(c, a[i][j]))
			} else if a[i][j].Description == Modified {
				aDay.Modified = append(aDay.Modified, VS.auditToAuditHTML(c, a[i][j]))
			} else if a[i][j].Description == Deleted {
				aDay.Deleted = append(aDay.Deleted, VS.auditToAuditHTML(c, a[i][j]))
			}
		}
		auditDay = append(auditDay, aDay)
	}
	return auditDay
}
// This methos transform the array of audits into a array of audits divided by the day of creation
This methos transform the array of audits into a array of audits divided by the day of creation
// This methos transform the array of audits into a array of audits divided by the day of creation
func (VS *Server) auditPerDayToHTML(c *gin.Context, a [][]Audit) []AuditDayHTML {
	var aDay AuditDayHTML
	var auditDay []AuditDayHTML
	if a == nil {
		return auditDay
	}
	if len(a) == 0 {
		return auditDay
	}
	for i := 0; i < len(a); i++ {
		aDay = (AuditDayHTML{})
		if len(a[i]) > 0 {
			y, m, d := time.Unix(a[i][0].Date, 0).Date()
			aDay.Date = time.Unix(a[i][0].Date, 0).Weekday().String() + ", " + strconv.Itoa(d) + " of " + m.String() + " of " + strconv.Itoa(y)
		}
		for j := 0; j < len(a[i]); j++ {
			if a[i][j].Description == Created {
				aDay.Created = append(aDay.Created, VS.auditToAuditHTML(c, a[i][j]))
			} else if a[i][j].Description == Modified {
				aDay.Modified = append(aDay.Modified, VS.auditToAuditHTML(c, a[i][j]))
			} else if a[i][j].Description == Deleted {
				aDay.Deleted = append(aDay.Deleted, VS.auditToAuditHTML(c, a[i][j]))
			}
		}
		auditDay = append(auditDay, aDay)
	}
	return auditDay
}
func ( VS * Server ) auditPerDayToHTML ( c * gin . Context , a [ ] [ ] Audit ) [ ] AuditDayHTML { var aDay AuditDayHTML var auditDay [ ] AuditDayHTML if a == nil { return auditDay } if len ( a ) == 0 { return auditDay } for i := 0 ; i < len ( a ) ; i ++ { aDay = ( AuditDayHTML { } ) if len ( a [ i ] ) > 0 { y , m , d := time . Unix ( a [ i ] [ 0 ] . Date , 0 ) . Date ( ) aDay . Date = time . Unix ( a [ i ] [ 0 ] . Date , 0 ) . Weekday ( ) . String ( ) + " " + strconv . Itoa ( d ) + " " + m . String ( ) + " " + strconv . Itoa ( y ) } for j := 0 ; j < len ( a [ i ] ) ; j ++ { if a [ i ] [ j ] . Description == Created { aDay . Created = append ( aDay . Created , VS . auditToAuditHTML ( c , a [ i ] [ j ] ) ) } else if a [ i ] [ j ] . Description == Modified { aDay . Modified = append ( aDay . Modified , VS . auditToAuditHTML ( c , a [ i ] [ j ] ) ) } else if a [ i ] [ j ] . Description == Deleted { aDay . Deleted = append ( aDay . Deleted , VS . auditToAuditHTML ( c , a [ i ] [ j ] ) ) } } auditDay = append ( auditDay , aDay ) } return auditDay }
This methos transform the array of audits into a array of audits divided by the day of creation
This methos transform the array of audits into a array of audits divided by the day of creation
// previousDayAudit := a[i][0].Date.Date()