Allow complete control over date & time formatting in queries, macros & templates

Hi,

This is a feature request for the ability to control the format of the date & time within queries, macros and templates regardless of what our config.edn is set to.

At the moment we are stuck with just the one date format, the one setup in our config.edn. This is very limiting.

We should be able to select any format we want when we need it, select just hour, just seconds, format it this way, yyyyMMddhhmmss for one macro and the next macro yyyy-MM-dd hh:mm

In Logseq I cannot make any template, query, or macro that lets me combine date and time in the page name.

For example, if I have a block property time, I should be able to query it via my own formatter in place.

For example:

type:: exercise
exercise-type:: running-far-and-wide
dt:: 2022_08_23 13:45

In the query/macro/template:

<% date("yyyy_MM_dd hh:mm") %>

I might have another query that does the following:

select all pages with the page title format <% date("yyyyMMddhhmmss") %>
between <% date("yyyy-MM-dd", 2021-08-01) %>
and <% date("yyyy-MM-dd", 2021-10-01) %>

This is querying my pages in zettelkasten format.

I would like to perform all of the above queries without changing any configuration.

Let us pass a date string as a formatter inside a dynamic variable.

Thanks!

I second this. My usage would be to include a URL pointing to Fantastical of a particular date in my daily journal template:

[Calendar](x-fantastical3://show/calendar/<% date("yyyy-MM-dd", today) %>)

If this works it will be wondeful!

1 Like

Just started using LogSeq and this is something I’d like to do. I’ve set up a template that adds a link to today’s journal page with space for a formatted date alias, but it would be great to have the alias be written automatically:
[formatted-date-alias](<%today%>)

Could you share this template please? Thank you! :slight_smile:

I would also appreciate this.

I do multi-day projects, and enter my logs with dated timestamps, currently via /cur [enter] /toda. I do it this way because it’s fast.

If I end up doing many steps during a day, I can end up with my project logs filling up the linked references for that day, which is visually unappealing, and adds substantial scroll time to my feed.

I would prefer to be able to enter unlinked dates via a template as easily as linked dates for this reason.