Skip to content

Commit

Permalink
Fix date format
Browse files Browse the repository at this point in the history
  • Loading branch information
Granjeon Alexandre committed Nov 23, 2021
1 parent 3f38e70 commit 8002b34
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,18 @@ gitplan consume
```

When a commit is pushed, you receive a notification


* `status`

Will return you a table of the commits that are yet to be pushed

```
$ gitplan status
+------------------+--------+------------------------+
| DATE | BRANCH | MESSAGE |
+------------------+--------+------------------------+
| 2021-11-23 13:38 | master | Add status command |
| 2021-11-23 13:53 | master | Forgot to add the file |
+------------------+--------+------------------------+
```
7 changes: 6 additions & 1 deletion status.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"io/ioutil"
"os"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -38,7 +39,11 @@ func Status() {
}

func humanDate(date string) string {
humanDate, _ := time.Parse(time.Stamp, date)
i, err := strconv.ParseInt(date, 10, 64)
if err != nil {
panic(err)
}
humanDate := time.Unix(i, 0)

return humanDate.Format("2006-01-02 15:04")
}

0 comments on commit 8002b34

Please sign in to comment.