-
Notifications
You must be signed in to change notification settings - Fork 194
Add dgt-converter package #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
22e49b7
3deac64
7282afc
3776c5d
d7cb19b
cf7a83c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # DGT Time Converter | ||
|
|
||
| Convert standard date-time into DTG/DGT format. | ||
|
|
||
| Example: | ||
|
|
||
| Input: | ||
| April 30, 2026 9:40 AM | ||
|
|
||
| Output: | ||
| 300940APR26 | ||
|
|
||
| ## Trigger | ||
|
|
||
| Type: | ||
|
|
||
| :dgt | ||
|
khaleeek marked this conversation as resolved.
|
||
|
|
||
| A popup will appear asking for date and time. | ||
|
khaleeek marked this conversation as resolved.
Comment on lines
+13
to
+19
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I commented above #224 (comment), I think this needs addressing to make the package usable. |
||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| espanso install dgt-converter | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: dgt-converter | ||
|
khaleeek marked this conversation as resolved.
|
||
| title: DGT Time Converter | ||
| description: Convert standard date and time into DTG/DGT format like 300940APR26. | ||
| version: 0.1.0 | ||
| author: Khaleeq Ur Rahman | ||
| homepage: https://github.com/khaleeek/hub | ||
| tags: | ||
| [ | ||
|
Comment on lines
+7
to
+8
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not overly concerned about this as long as it's valid YAML. |
||
| "datetime", | ||
| "time", | ||
| "converter", | ||
| "dtg", | ||
| "dgt", | ||
| "aviation", | ||
| "military", | ||
| "timestamp", | ||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| matches: | ||
| - trigger: ":dgt" | ||
|
khaleeek marked this conversation as resolved.
|
||
|
|
||
| vars: | ||
| - name: form1 | ||
| type: form | ||
| params: | ||
| layout: "Enter Date Time [[dt]]" | ||
|
khaleeek marked this conversation as resolved.
|
||
|
|
||
| - name: output | ||
| type: shell | ||
| params: | ||
| shell: powershell | ||
|
khaleeek marked this conversation as resolved.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is tricky.
|
||
| cmd: | | ||
| $x = "{{form1.dt}}" | ||
| $dt = [datetime]::ParseExact($x, "MMMM d, yyyy h:mm tt", $null) | ||
|
khaleeek marked this conversation as resolved.
|
||
| $dt.ToString("ddHHmmMMMyy").ToUpper() | ||
|
Comment on lines
+16
to
+17
Comment on lines
+16
to
+17
|
||
|
|
||
| replace: "{{output}}" | ||
Uh oh!
There was an error while loading. Please reload this page.