Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Listing with ability to specify the date formatting string #625

Closed
bokchan opened this issue Feb 9, 2019 · 6 comments
Closed

Listing with ability to specify the date formatting string #625

bokchan opened this issue Feb 9, 2019 · 6 comments

Comments

@bokchan
Copy link

bokchan commented Feb 9, 2019

In the list views the date is formatted as relative i.e.:

> gh is -M 40 -u username -S closed 

Listing closed issues on username/myrepo
#337 One patch @bokchan (a day ago)
.....
#333 Last patch @bokchan (a month ago)

The order/formatting of PR number, title, and github username can be manipulated with sed, but it could be really nice to be able to specify the formatting of the date, .e.g

> gh is -M 40 -u bokchan -S closed --date-format%Y-%m-%d

Listing closed issues on bokchan/myrepo
#337 One patch @bokchan (2019-02-10)
.....
#333 Last patch @bokchan (2018-01-10)
@protoEvangelion
Copy link
Member

Hey @bokchan, right now we only have to views: detailed and non detailed. Can you give some examples of what you are looking to print out and not print out?

@bokchan
Copy link
Author

bokchan commented Feb 11, 2019

Hi @protoEvangelion
First of all, thanks for a great tool!

The question came up because I wanted to generate a changelog from a milestone which lists the datetime as relative

> gh is -M 40 -u bokchan -S closed 

Listing closed issues on bokchan/myrepo
#337 One patch @bokchan (a day ago)
.....
#333 Last patch @bokchan (a month ago)

The order/formatting of PR number, title, and github username can be manipulated with sed, but it could be really nice to be able to specify the formatting of the date, .e.g

> gh is -M 40 -u bokchan -S closed --date-format%Y-%m-%d

Listing closed issues on bokchan/myrepo
#337 One patch @bokchan (2019-02-10)
.....
#333 Last patch @bokchan (2018-01-10)

@protoEvangelion
Copy link
Member

Thanks for the clarification. So we use moment for our date parsing. Would something like this work for you? https://momentjs.com/docs/#/displaying/format/

@bokchan
Copy link
Author

bokchan commented Feb 12, 2019

Thanks for the clarification. So we use moment for our date parsing. Would something like this work for you? https://momentjs.com/docs/#/displaying/format/

If you mean the formatting capabilities offered by momentjs, then yes that would be more sufficient :)

I will change the title and description to make the issue clearer

@bokchan bokchan changed the title Listing with ability to specify the formatting string Listing with ability to specify the date formatting string Feb 12, 2019
protoEvangelion pushed a commit to protoEvangelion/gh that referenced this issue Feb 12, 2019
@protoEvangelion
Copy link
Member

@bokchan I just added the ability to pass in a formatter like gh is --date "ddd, hA" here: #626

It should also now work for all other list based cmds.

You can check it out by forking, cloning, then running:

gh pr 626 -u node-gh

and following instructions here to build and link it. Let me know if that achieves what you are looking for 😉

protoEvangelion pushed a commit to protoEvangelion/gh that referenced this issue Feb 12, 2019
protoEvangelion pushed a commit that referenced this issue Feb 13, 2019
protoEvangelion pushed a commit that referenced this issue Feb 13, 2019
# [1.15.0](v1.14.1...v1.15.0) (2019-02-13)

### Features

* **list based cmds:** enable moment date formatting for cmds that have listing functionality ([d9d652e](d9d652e)), closes [#625](#625)
@protoEvangelion
Copy link
Member

🎉 This PR is included in version 1.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants