-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: countdown timer to specific timezone events (#19)
- Loading branch information
1 parent
85e5907
commit 0f39415
Showing
4 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Get Count down To Event | ||
|
||
## Description | ||
|
||
This feature calculates the countdown to a specified event date in a given timezone and returns the countdown in a human-readable format. | ||
|
||
## Usage | ||
|
||
```javascript | ||
import { getCountdownToEvent } from 'world-clockify'; | ||
|
||
const eventDate = '2024-10-20T15:00:00'; | ||
const eventTimezone = 'America/New_York'; | ||
|
||
const countdown = getCountdownToEvent(eventDate, eventTimezone); | ||
console.log(countdown); | ||
``` | ||
|
||
## Expected Output | ||
|
||
```bash | ||
1 day, 1 hour, 30 minutes, 0 seconds | ||
``` | ||
|
||
## Parameters | ||
|
||
- eventDate (string): The event date string in ISO format. | ||
- eventTimezone (string): The timezone of the event. | ||
|
||
## Returns | ||
|
||
Returns the countdown as an object with `{ days, hours, minutes, seconds }` ensuring each value is floored to the nearest integer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters