Skip to content

[BUG] The date passed as a parameter is not rendered in the template as a date #1074

@laughtingman

Description

@laughtingman

Describe the bug
The date passed as a parameter is not rendered in the template as a date.

To Reproduce

  1. Create a template choise named dated_note with file template content:
# {{VDATE:date,DD MMMM YYYY}}, {{VDATE:date,dddd}}
  1. Try to execute the template throw javascript API with the specific date:
app.plugins.plugins.quickadd.api.executeChoice("dated_note", {date: "2026-12-31"})
  1. Or throw the obsidian url:
obsidian://quickadd?choice=dated_note&value-date=2026-12-31

Expected behavior
Will be created a note with content:

# 31 December 2026, Thursday

Fact behavior

# 2026-12-31, 2026-12-31

However, if I run this template through the command palette and enter the date in the pop-up window, everything works correctly.

I expect that seeing the VDATE keyword in template QuickAdd will attempt to convert the parameter to a date and then output it in the required format. In fact, no conversion to a date occurs and the parameter is simply output in the template as a string, ignoring the format.

An alternative solution I see is to explicitly pass the parameter type, but I didn't find in the documentation how to do this.

Obsidian Debug Info

SYSTEM INFO:
	Obsidian version: v1.10.6
	Installer version: v1.5.12
	Operating system: Windows 10 Pro 10.0.26100
	Login status: not logged in
	Language: ru
	Insider build toggle: off
	Live preview: off
	Base theme: dark
	Community theme: AnuPpuccin v1.5.0
	Snippets enabled: 3
	Restricted mode: off
	Plugins installed: 19
	Plugins enabled: 1
		1: QuickAdd v2.9.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions