Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions packages/dgt-converter/0.1.0/README.md
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
Comment thread
khaleeek marked this conversation as resolved.

## Trigger

Type:

:dgt
Comment thread
khaleeek marked this conversation as resolved.

A popup will appear asking for date and time.
Comment thread
khaleeek marked this conversation as resolved.
Comment on lines +13 to +19

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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
```
17 changes: 17 additions & 0 deletions packages/dgt-converter/0.1.0/_manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: dgt-converter
Comment thread
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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",
]
19 changes: 19 additions & 0 deletions packages/dgt-converter/0.1.0/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
matches:
- trigger: ":dgt"
Comment thread
khaleeek marked this conversation as resolved.

vars:
- name: form1
type: form
params:
layout: "Enter Date Time [[dt]]"
Comment thread
khaleeek marked this conversation as resolved.

- name: output
type: shell
params:
shell: powershell
Comment thread
khaleeek marked this conversation as resolved.

@smeech smeech May 16, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is tricky.

  • shell: powershell will work on most versions of Windows, but will only work (somewhat slowly) in Linux or macOS if pwsh is installed and either the line is changed to shell: pwsh or the user has "powershell" symlinked to pwsh. I like the explanation at the bottom of this page.
  • shell: pwsh may fail in some Windows instances if pwsh.exe isn't installed, so is not ideal.

cmd: |
$x = "{{form1.dt}}"
$dt = [datetime]::ParseExact($x, "MMMM d, yyyy h:mm tt", $null)
Comment thread
khaleeek marked this conversation as resolved.
$dt.ToString("ddHHmmMMMyy").ToUpper()
Comment on lines +16 to +17
Comment on lines +16 to +17

replace: "{{output}}"
Loading