[PR #244] [MERGED] add template-function-datetime #170

Closed
opened 2025-12-29 07:19:38 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mountain-loop/yaak/pull/244
Author: @subframe7536
Created: 7/19/2025
Status: Merged
Merged: 7/23/2025
Merged by: @gschier

Base: mainHead: fn-datetime


📝 Commits (4)

  • dabbd3d add template-function-datetime
  • 5584d54 Merge branch 'main' into fn-datetime
  • 1b2b250 Some improvements before merging
  • 470da62 Tweak args

📊 Changes

20 files changed (+331 additions, -51 deletions)

View changed files

📝 package-lock.json (+11 -0)
📝 package.json (+1 -0)
📝 packages/plugin-runtime-types/src/bindings/gen_events.ts (+1 -1)
📝 packages/plugin-runtime/src/PluginInstance.ts (+21 -9)
plugins/template-function-datetime/package.json (+13 -0)
plugins/template-function-datetime/src/index.ts (+156 -0)
plugins/template-function-datetime/tests/formatDatetime.test.ts (+71 -0)
plugins/template-function-datetime/tsconfig.json (+3 -0)
📝 src-tauri/src/uri_scheme.rs (+1 -1)
📝 src-tauri/yaak-plugins/bindings/gen_events.ts (+1 -1)
📝 src-tauri/yaak-plugins/src/events.rs (+2 -0)
📝 src-tauri/yaak-plugins/src/manager.rs (+20 -10)
📝 src-web/components/TemplateFunctionDialog.tsx (+23 -22)
📝 src-web/components/core/Editor/Editor.tsx (+1 -1)
📝 src-web/components/core/Icon.tsx (+1 -1)
📝 src-web/components/core/IconTooltip.tsx (+1 -0)
📝 src-web/components/core/Input.tsx (+1 -1)
📝 src-web/components/core/Label.tsx (+1 -1)
📝 src-web/hooks/useRenderTemplate.ts (+2 -2)
📝 src-web/hooks/useTemplateTokensToString.ts (+0 -1)

📄 Description

In this PR, I added 4 template functions for datetime with date-fns:

  • datetime.timestamp: Returns current timestamp in milliseconds.
  • datetime.iso: Returns current date in ISO format.
  • datetime.calculate: Supports date arithmetic (e.g., +1d,-2h) and returns ISO string.
  • datetime.format: Formats a date string with a custom output format.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mountain-loop/yaak/pull/244 **Author:** [@subframe7536](https://github.com/subframe7536) **Created:** 7/19/2025 **Status:** ✅ Merged **Merged:** 7/23/2025 **Merged by:** [@gschier](https://github.com/gschier) **Base:** `main` ← **Head:** `fn-datetime` --- ### 📝 Commits (4) - [`dabbd3d`](https://github.com/mountain-loop/yaak/commit/dabbd3dd8223036e380a30e06c635db3d3428a1b) add `template-function-datetime` - [`5584d54`](https://github.com/mountain-loop/yaak/commit/5584d540735cf1cb94e4cd5449af571971e6da24) Merge branch 'main' into fn-datetime - [`1b2b250`](https://github.com/mountain-loop/yaak/commit/1b2b250852df516274eac2f85957dcf59a201df4) Some improvements before merging - [`470da62`](https://github.com/mountain-loop/yaak/commit/470da6252bf4ad9176a1d954e2932d066b198b16) Tweak args ### 📊 Changes **20 files changed** (+331 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+11 -0) 📝 `package.json` (+1 -0) 📝 `packages/plugin-runtime-types/src/bindings/gen_events.ts` (+1 -1) 📝 `packages/plugin-runtime/src/PluginInstance.ts` (+21 -9) ➕ `plugins/template-function-datetime/package.json` (+13 -0) ➕ `plugins/template-function-datetime/src/index.ts` (+156 -0) ➕ `plugins/template-function-datetime/tests/formatDatetime.test.ts` (+71 -0) ➕ `plugins/template-function-datetime/tsconfig.json` (+3 -0) 📝 `src-tauri/src/uri_scheme.rs` (+1 -1) 📝 `src-tauri/yaak-plugins/bindings/gen_events.ts` (+1 -1) 📝 `src-tauri/yaak-plugins/src/events.rs` (+2 -0) 📝 `src-tauri/yaak-plugins/src/manager.rs` (+20 -10) 📝 `src-web/components/TemplateFunctionDialog.tsx` (+23 -22) 📝 `src-web/components/core/Editor/Editor.tsx` (+1 -1) 📝 `src-web/components/core/Icon.tsx` (+1 -1) 📝 `src-web/components/core/IconTooltip.tsx` (+1 -0) 📝 `src-web/components/core/Input.tsx` (+1 -1) 📝 `src-web/components/core/Label.tsx` (+1 -1) 📝 `src-web/hooks/useRenderTemplate.ts` (+2 -2) 📝 `src-web/hooks/useTemplateTokensToString.ts` (+0 -1) </details> ### 📄 Description In this PR, I added 4 template functions for datetime with `date-fns`: - `datetime.timestamp`: Returns current timestamp in milliseconds. - `datetime.iso`: Returns current date in ISO format. - `datetime.calculate`: Supports date arithmetic (e.g., `+1d,-2h`) and returns ISO string. - `datetime.format`: Formats a date string with a custom output format. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 07:19:38 +01:00
adam closed this issue 2025-12-29 07:19:38 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/yaak#170