<?php
namespace App\Helpers;
class DateHelper{
    public static function filterDate($date){
        return (bool)strtotime($date);
    }

    public static function calculateAge($birthDate, $currentDate){
        $birth = new \DateTime($birthDate);
        $current = new \DateTime($currentDate);
        return $current->diff($birth)->y ?: 1;
    }

    public static function formatDate($date) {
        if (!$date) return '';
        return date('d/m/Y', strtotime($date));
    }
}
