mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
parse dates into datetimes
This makes it so nu treats the dates as actual dates, and displays them accordingly.
This commit is contained in:
parent
5a4027defe
commit
39a6b960c5
1 changed files with 14 additions and 5 deletions
|
@ -1,6 +1,15 @@
|
|||
# Creates a table listing the branches of a git repository and the day of the last commit
|
||||
git branch | lines | str substring 2, | wrap name | insert "last commit" {
|
||||
get name | each {
|
||||
git show $it --no-patch --format=%as
|
||||
}
|
||||
} | sort-by "last commit"
|
||||
def "git age" [] {
|
||||
git branch |
|
||||
lines |
|
||||
str substring 2, |
|
||||
wrap name |
|
||||
insert date {
|
||||
get name |
|
||||
each {
|
||||
git show $it --no-patch --format=%as | str to-datetime
|
||||
}
|
||||
} |
|
||||
sort-by date
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue