Skip to content

Commit

Permalink
fish: Show yesterdays date
Browse files Browse the repository at this point in the history
Now with --long version
  • Loading branch information
oschrenk committed Aug 19, 2015
1 parent 936d013 commit d85d8aa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .config/fish/functions/yesterday.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
function yesterday --description "Show yesterdays date is ISO-8601 format"
echo $argv | read -l flag

set -l yesterday (expr (date +%s) - 86400)

if test -z $flag
set format '+%Y%m%d'
end

switch $flag
case "--long"
set format '+%A, %B %d %Y '

end

date -r $yesterday $format
end

0 comments on commit d85d8aa

Please sign in to comment.