Skip to content

Commit

Permalink
Updated Readme with demos
Browse files Browse the repository at this point in the history
  • Loading branch information
devppratik committed Feb 17, 2023
1 parent b9a91e2 commit d9b60ec
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 24 deletions.
141 changes: 117 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
<img src="https://i.imgur.com/ZebplfT.png" width="110" align="left"/><h1>Go Timezone CLI</h1>
<h1>Go Timezone CLI</h1>

<p><strong>A CLI Tool for timezones :zap:</strong></p>
<p><strong>A CLI Tool for timezones made using golang :zap:</strong></p>

## What can `go-timezones-cli` do? :sparkles:
- Search for date and time based on country, or timezones.
- Manage list for timezones you frequently view.
- Get UTC date and time based on your local timezone or any timezones.
- Convert time across timezones

## Credits
- Special thanks to @MitaliBhalla for the idea & feedback on the project.
- Also thanks to @supreeth7 for providing code review & feedback on the project

## Contents

- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Running the CLI](#running-the-cli)
- [Commands](#commands)
- [Search for local date time](#search-for-local-date-time)
- [Search based on timezone abbreviations](#search-based-on-timezone-abbreviations)
- [Add timezones](#add-timezones)
- [Remove timezones](#remove-timezones)
- [Show local datetime of all saved timezones](#show-local-datetime-of-all-saved-timezones)
- [Show & Convert between timezones](#show-and-convert-between-timezones)
- [Select a single timezone from defaults](#select-a-single-timezone-from-defaults)
- [Get UTC time](#get-utc-time)
- [Use Interactive UI](#get-interactive-ui)
- [Future Work](#future-work)
- [Contributing and Feedback](#contribution)


## Prerequisites
Expand Down Expand Up @@ -54,84 +62,169 @@ To run command with the full name:
```shell
$ tmz <command> [flags] <string>
```
> **NOTE:** [List of country codes or timezone names](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) :earth:
> **NOTE:** [List of country codes or timezone names](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) :earth_asia:
## Commands

### Search for local date time

Search can be done via country code or country name or city name that is included in the timezone list

#### Usage
```
tmz search <search-term>
```


```shell
$ tmz search "us"

$ tmz search "kol"
```
<details><summary><strong>Demo</strong></summary>

<img src = "demos/search.gif" width="700" alt="demo of search search" />
</details>

---
### Search based on timezone abbreviations
To search for a timezone based on abbreviation its abbreviations e.g IST

### Usage
```
tmz get <abbreviation> [time]
```

```bash
$ tmz get "ist"

$ tmz get "est"
```
To get the converted time at the zone provide the local time as one of the arguments

```bash
$ tmz get "jst" 10:56
```
<details><summary><strong>Demo</strong></summary>
<img src = "demos/get.gif" width="700" alt="demo of search search" />
</details>

---

### Add timezones

Timezones added to the config file are treated as the default timezones which is triggered by the `tmz show` command.
Timezones added to the config file are treated as the default timezones which is triggered by the `tmz show --all` command.

> file is stored at ~/.tmz.list
If the timezone already exists, the CLI throws an error.

> config file is stored at ~/.tmz.list
#### Usage
```
tmz add <timezone>
```

```bash
$ tmz add "Asia/Kolkata"
```
<details><summary><strong>Demo</strong></summary>
<img src = "demos/add.gif" width="700" alt="demo of search search" />
</details>

---

### Remove timezones

Timezones are removed from the config file
#### Usage
```
tmz remove <timezone>
```

```bash
$ tmz remove "Asia/Kolkata"
```
<details><summary><strong>Demo</strong></summary>
<img src = "demos/remove.gif" width="700" alt="demo of search search" />
</details>

---

### Show local datetime of all saved timezones
### Show and Convert between timezones

```bash
$ tmz show
```
- This comand will help you to convert between timezones.
- The first timezone passed as argument is set as the default timezone. Other time are calculated based on it.

To get the time based on a different local time use
#### Usage
```
tmz show <time>
tmz show <timezone1> [timezone2, timezone3 ...] [--all] [--time time]
$ tmz show "21:45"
Flags:
--all Load all Timezones from local config
-t, --time string Show the list at a different time
```
- The `--time` flag will accept an time which will be used to show the list based on that time
- The `--all` flag will load all the timezones saved on the config file

```bash
$ tmz show --all

$ tmz show "Asia/Jakarta" -t=10:56
```
---

### Select a single timezone from defaults

```bash
$ tmz select
To get a list of all local timezones that are saved in the config file.
#### Usage
```
tmz select
```
On selection it will provide an option to show the current time or convert the time based on provided local time

<details><summary><strong>Demo</strong></summary>
<img src = "demos/select.gif" width="700" alt="demo of search search" />
</details>

---

### Get UTC time

Get UTC time based on current system time.
#### Usage
```
tmz utc
```
<details><summary><strong>Demo</strong></summary>
<img src = "demos/utc.gif" width="700" alt="demo of search search" />
</details>

---
### Get Interactive UI

Get an Interactive UI to see time across timezones.
#### Usage
```
tmz visual [timezone1, timezone2, ...] [--all]
Flags:
--all Load all Timezones from locally saved timezones
```

```bash
$ tmz utc
$ tmz visual --all
$ tmz visual "Asia/Kolkata" "Europe/Berlin"
```
<details><summary><strong>Demo</strong></summary>
<img src = "demos/visual.gif" width="700" alt="demo of search search" />
</details>

## Planned Features, Updates & Future Work
- Search for timezones & display local time
- Manage list of timezones
- UTC & Local Time Conversion
- Time Conversion from TimeZone to Local Time
- Interactive Time View Across Time Zones
---
## Future Work
- Redefined search
- Time Format Configuration
- Support for 24 Hrs instead of 12 Hrs
- Code Modularity & Improvements
- Work with Daylight Savings

## Feedback and Contribution
The project is open for feedback & contribution from all talented people across the globe. Feel free to reach out to me for any suggestions or improvemnts.

If there is an issue do open up a PR for the same
Binary file added demos/add.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/get.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/remove.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/search.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/select.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/show.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/utc.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/visual.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d9b60ec

Please sign in to comment.