func (VS *Server) messagePerDayToHTML(c *gin.Context, idUser bson.ObjectId, a [][]Message) []MessageDayHTML {
	var aDay MessageDayHTML
	var auditDay []MessageDayHTML
	// 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 = (MessageDayHTML{})
		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)
		}
		aDay.Messages = VS.messagesToHTML(c, idUser, a[i])
		auditDay = append(auditDay, aDay)
	}
	return auditDay
}
// This methos transform the array of messages into a array of messages divided by the day of creation
This methos transform the array of messages into a array of messages divided by the day of creation
// This methos transform the array of messages into a array of messages divided by the day of creation
func (VS *Server) messagePerDayToHTML(c *gin.Context, idUser bson.ObjectId, a [][]Message) []MessageDayHTML {
	var aDay MessageDayHTML
	var auditDay []MessageDayHTML
	if a == nil {
		return auditDay
	}
	if len(a) == 0 {
		return auditDay
	}
	for i := 0; i < len(a); i++ {
		aDay = (MessageDayHTML{})
		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)
		}
		aDay.Messages = VS.messagesToHTML(c, idUser, a[i])
		auditDay = append(auditDay, aDay)
	}
	return auditDay
}
func ( VS * Server ) messagePerDayToHTML ( c * gin . Context , idUser bson . ObjectId , a [ ] [ ] Message ) [ ] MessageDayHTML { var aDay MessageDayHTML var auditDay [ ] MessageDayHTML if a == nil { return auditDay } if len ( a ) == 0 { return auditDay } for i := 0 ; i < len ( a ) ; i ++ { aDay = ( MessageDayHTML { } ) 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 ) } aDay . Messages = VS . messagesToHTML ( c , idUser , a [ i ] ) auditDay = append ( auditDay , aDay ) } return auditDay }
This methos transform the array of messages into a array of messages divided by the day of creation
This methos transform the array of messages into a array of messages divided by the day of creation
// previousDayAudit := a[i][0].Date.Date()