From 6779e10759c7c45f18a3ade1efac4d87b5ded7f1 Mon Sep 17 00:00:00 2001 From: Frani Date: Sat, 12 Jun 2021 10:08:27 -0300 Subject: [PATCH] feat(plugins): Add new isodate plugin for friendly date formatting commands (#9963) * add isodate plugin --- plugins/isodate/README.md | 22 ++++++++++++++++++++++ plugins/isodate/isodate.plugin.zsh | 7 +++++++ 2 files changed, 29 insertions(+) create mode 100644 plugins/isodate/README.md create mode 100644 plugins/isodate/isodate.plugin.zsh diff --git a/plugins/isodate/README.md b/plugins/isodate/README.md new file mode 100644 index 000000000..1ec75b2d4 --- /dev/null +++ b/plugins/isodate/README.md @@ -0,0 +1,22 @@ +# Isodate plugin + +**Maintainer:** [@Frani](https://github.com/frani) + +This plugin adds completion for the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), +as well as some aliases for common Date commands. + +To use it, add `isodate` to the plugins array in your zshrc file: + +```zsh +plugins=(... isodate) +``` + +## Aliases + +| Alias | Command | Description | +|---------------|--------------------------------------|----------------------------------------------------------------------------| +| isodate | `date +%Y-%m-%dT%H:%M:%S%z` | Display the current date with UTC offset and ISO 8601-2 extended format | +| isodate_utc | `date -u +%Y-%m-%dT%H:%M:%SZ` | Display the current date in UTC and ISO 8601-2 extended format | +| isodate_basic | `date -u +%Y%m%dT%H%M%SZ` | Display the current date in UTC and ISO 8601 basic format | +| unixstamp | `date +%s` | Display the current date as a Unix timestamp (seconds since the Unix epoch)| +| date_locale | `date +"%c"` | Display the current date using the default locale's format | diff --git a/plugins/isodate/isodate.plugin.zsh b/plugins/isodate/isodate.plugin.zsh new file mode 100644 index 000000000..1a827e785 --- /dev/null +++ b/plugins/isodate/isodate.plugin.zsh @@ -0,0 +1,7 @@ +# work with date ISO 8601 easy + +alias isodate="date +%Y-%m-%dT%H:%M:%S%z" +alias isodate_utc="date -u +%Y-%m-%dT%H:%M:%SZ" +alias isodate_basic="date -u +%Y%m%dT%H%M%SZ" +alias unixstamp="date +%s" +alias date_locale="date +"%c""