6779e10759c7c45f18a3ade1efac4d87b5ded7f1

Author
Frani <frani@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(plugins): Add new isodate plugin for friendly date formatting commands (#9963)

* add isodate plugin

Diff

 1diff --git a/plugins/isodate/README.md b/plugins/isodate/README.md
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..1ec75b2d47527773a94940fd267940e7f74fa39d
 4--- /dev/null
 5+++ b/plugins/isodate/README.md
 6@@ -0,0 +1,22 @@
 7+# Isodate plugin
 8+
 9+**Maintainer:** [@Frani](https://github.com/frani)
10+
11+This plugin adds completion for the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601),
12+as well as some aliases for common Date commands.
13+
14+To use it, add `isodate` to the plugins array in your zshrc file:
15+
16+```zsh
17+plugins=(... isodate)
18+```
19+
20+## Aliases
21+
22+| Alias         | Command                              | Description                                                                |
23+|---------------|--------------------------------------|----------------------------------------------------------------------------|
24+| isodate       | `date +%Y-%m-%dT%H:%M:%S%z`          | Display the current date with UTC offset and ISO 8601-2 extended format    |
25+| isodate_utc   | `date -u +%Y-%m-%dT%H:%M:%SZ`        | Display the current date in UTC and ISO 8601-2 extended format             |
26+| isodate_basic | `date -u +%Y%m%dT%H%M%SZ`            | Display the current date in UTC and ISO 8601 basic format                  |
27+| unixstamp     | `date +%s`                           | Display the current date as a Unix timestamp (seconds since the Unix epoch)|
28+| date_locale   | `date +"%c"`                         | Display the current date using the default locale's format                 |
29diff --git a/plugins/isodate/isodate.plugin.zsh b/plugins/isodate/isodate.plugin.zsh
30new file mode 100644
31index 0000000000000000000000000000000000000000..1a827e7856b5baf181f61e83a1ab7070cd0ac056
32--- /dev/null
33+++ b/plugins/isodate/isodate.plugin.zsh
34@@ -0,0 +1,7 @@
35+# work with date ISO 8601 easy
36+
37+alias isodate="date +%Y-%m-%dT%H:%M:%S%z"
38+alias isodate_utc="date -u +%Y-%m-%dT%H:%M:%SZ"
39+alias isodate_basic="date -u +%Y%m%dT%H%M%SZ"
40+alias unixstamp="date +%s"
41+alias date_locale="date +"%c""