-
-
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.
docs: Add detailed guides for key features and improve installation i…
…nstructions
- Loading branch information
1 parent
df71f2b
commit cf23f82
Showing
8 changed files
with
166 additions
and
4 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
<details open style="margin-left: 33px"> | ||
<details open> | ||
<summary>Welcome</summary> | ||
|
||
- [Introduction](./home.md) | ||
- [Installation](./guide/installation.md) | ||
|
||
</details> | ||
|
||
<details open style="margin-left: 33px"> | ||
<details open style="margin-left: 20px"> | ||
<summary>How to Use</summary> | ||
|
||
- [Get Current Time in Zone](./guide/getCurrentTimeInZone.md) | ||
- [Convert Time Zone](./guide/convertTimeZone.md) | ||
- [Time Zone Offset Difference](./guide/getTimeZoneOffsetDifference.md) | ||
- [Format Date in Time Zone](./guide/formatDateInTimeZone.md) | ||
- [Calculate Duration](./guide/calculateDuration.md) | ||
|
||
</details> |
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,30 @@ | ||
Calculate Duration | ||
|
||
## Description | ||
|
||
This feature allows you to calculate the duration between two dates in a specified unit. | ||
|
||
## Usage | ||
|
||
```javascript | ||
import { calculateDuration } from 'world-clockify'; | ||
|
||
const duration = calculateDuration('2023-10-01T12:00:00', '2023-10-02T12:00:00', 'hours'); | ||
console.log('Duration (in hours):', duration); | ||
``` | ||
|
||
## Expected Output | ||
|
||
```bash | ||
Duration (in hours): 24 | ||
``` | ||
|
||
## Parameters | ||
|
||
- startDate (string): The start date string in ISO format. | ||
- endDate (string): The end date string in ISO format. | ||
- unit (string): The unit to calculate the duration (hours, minutes, seconds, days, months, years). | ||
|
||
## Returns | ||
|
||
- (number): The duration between the two dates in the specified unit. |
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,30 @@ | ||
# Convert Time Zone | ||
|
||
## Description | ||
|
||
This feature allows you to convert a date/time from one timezone to another. | ||
|
||
## Usage | ||
|
||
```javascript | ||
import { convertTimeZone } from 'world-clockify'; | ||
|
||
const convertedTime = convertTimeZone('2023-10-01T12:00:00', 'America/New_York', 'Asia/Kolkata'); | ||
console.log('Converted Time:', convertedTime); | ||
``` | ||
|
||
## Expected Output | ||
|
||
```bash | ||
Converted Time: 2023-10-01T21:30:00+05:30 | ||
``` | ||
|
||
## Parameters | ||
|
||
- dateStr (string): The date string in ISO format. | ||
- fromZone (string): The source timezone. | ||
- toZone (string): The target timezone. | ||
|
||
## Returns | ||
|
||
- (string): The converted date/time in ISO format. |
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,36 @@ | ||
# Format Date in Time Zone | ||
|
||
## Description | ||
|
||
This feature allows you to format a date string for a given timezone in the specified format. | ||
|
||
## Usage | ||
|
||
```javascript | ||
import { formatDateInTimeZone } from 'world-clockify'; | ||
|
||
const formattedDate = formatDateInTimeZone( | ||
'2023-10-01T12:00:00', | ||
'America/New_York', | ||
'Asia/Kolkata', | ||
'yyyy LLL dd HH:mm:ss', | ||
); | ||
console.log('Formatted Date:', formattedDate); | ||
``` | ||
|
||
## Expected Output | ||
|
||
```bash | ||
Formatted Date: 2023 Oct 02 21:30:00 | ||
``` | ||
|
||
## Parameters | ||
|
||
- dateStr (string): The date string in ISO format. | ||
- fromZone (string): The source timezone. | ||
- toZone (string): The target timezone. | ||
- format (string): The format to use for the output date string. | ||
|
||
## Returns | ||
|
||
- (string): The formatted string in the target timezone. |
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,30 @@ | ||
# Get Current Time in Zone | ||
|
||
## Description | ||
|
||
This feature allows you to get the current time in any specified timezone. | ||
|
||
## Usage | ||
|
||
```javascript | ||
import { getCurrentTimeInZone } from 'world-clockify'; | ||
|
||
const currentTimeInKolkata = getCurrentTimeInZone('Asia/Kolkata'); | ||
console.log('Current Time in Kolkata:', currentTimeInKolkata); | ||
``` | ||
|
||
## Expected Output | ||
|
||
Note: The actual output will vary depending on the current time when the function is called | ||
|
||
```bash | ||
Current Time in Kolkata: 2023-10-01T21:30:00+05:30 | ||
``` | ||
|
||
## Parameters | ||
|
||
- timezone (string): The timezone to get the current time. | ||
|
||
## Returns | ||
|
||
- (string): The current date/time in ISO format. |
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,29 @@ | ||
# Get Time Zone Offset Difference | ||
|
||
## Description | ||
|
||
This feature allows you to calculate the time difference (in hours) between two timezones. | ||
|
||
## Usage | ||
|
||
```javascript | ||
import { getTimeZoneOffsetDifference } from 'world-clockify'; | ||
|
||
const timeDifference = getTimeZoneOffsetDifference('America/New_York', 'Asia/Kolkata'); | ||
console.log('Time Difference (in hours):', timeDifference); | ||
``` | ||
|
||
## Expected Output | ||
|
||
```bash | ||
Time Difference (in hours): 9.5 | ||
``` | ||
|
||
## Parameters | ||
|
||
- timezone1 (string): The first timezone. | ||
- timezone2 (string): The second timezone. | ||
|
||
## Returns | ||
|
||
- (number): The time difference (in hours) between the two timezones. |
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