This repository contains a custom React hook, useCountdownTimer, designed to facilitate countdown functionality in React applications. The hook takes a deadline in string format as its input and continuously updates the remaining time until that deadline.
Features:
- Dynamic Countdown Calculation: The hook dynamically calculates the remaining time in years, days, hours, minutes, and seconds based on the provided deadline.
- Automatic Formatting: The remaining time is automatically formatted with leading zeros for consistent display.
- Interval Updates: The hook utilizes the useEffect hook to set up an interval that updates the remaining time every second, ensuring real-time countdown accuracy.
Date Formats:
- ISO 8601 format: "2024-02-05T12:30:00Z"
- Standard JavaScript format: "February 5, 2024 12:30:00"