add documentation lines

This commit is contained in:
2024-08-27 10:15:11 +03:00
parent cb31616a87
commit db96f0e2e4
3 changed files with 11 additions and 2 deletions

View File

@@ -2,7 +2,8 @@ package utils
import "time"
// CalculateAge calculates the age based on a given birthdate and the current date in the format dd/mm/yy
// It adjusts for cases where the current date is before the birthday in the current year.
func CalculateAge(birthdate, today time.Time) int {
today = today.In(birthdate.Location())
ty, tm, td := today.Date()