# Issue #205: Date Calculations Duplicated in Frontend

## Problem

The `MemberList.vue` component contains duplicate date calculation logic for `alter` (age) and `mitgliedsdauer` (membership duration) that also exists in the backend `MemberService`:

**Backend** (`lib/Service/MemberService.php`):
```php
private function calculateMitgliedsdauer(Member $member): string {
    $eintritt = new DateTime($member->getEintritt());
    $end = $member->getAustritt()
        ? new DateTime($member->getAustritt())
        : new DateTime();
    $diff = $eintritt->diff($end);
    // ...
}
```

**Frontend** (`src/views/MemberList.vue`):
```javascript
function calculateAge(geburtsdatum) {
    const birth = new Date(geburtsdatum)
    const today = new Date()
    let age = today.getFullYear() - birth.getFullYear()
    // ...
}

function calculateMitgliedsdauer(eintritt) {
    const start = new Date(eintritt)
    const today = new Date()
    // ...
}
```

## Impact

- Inconsistent calculations if date logic changes
- Maintenance burden (two places to update)
- Potential for bugs if frontend and backend diverge

## Solution

1. **Option A (Recommended)**: Calculate `alter` and `mitgliedsdauer` in the backend and include them in the API response
2. **Option B**: Extract to a shared utility in a format both can use (e.g., precompute in migration, or use a build-time code generator)

## Tasks

- [ ] Add `alter` and `mitgliedsdauer` to `Member::jsonSerialize()`
- [ ] Update `MemberService::buildMemberResponse()` to compute these values
- [ ] Remove duplicate calculations from `MemberList.vue`
- [ ] Verify frontend displays match backend calculations
- [ ] Update any other views using these calculations

## Labels

- refactoring
- frontend
- backend
- priority:medium