Skip to content

View field type(s) for dates and durations #628

@KillyMXI

Description

@KillyMXI

Please fill out these Check-boxes

  • I checked for existing similar feature requests
  • I have read the docs and checked that the feature I am requesting is not already implemented
  • My feature request consists of only one feature

Is your Feature Request related to a Problem or Annoyance?

I need to show some computed duration inline.
Previously I was using Dataview, but as I'm migrating to Datacore, I'm looking for better alternatives for other features missing in Datacore.

Inline Dataview example:
= durationformat(date("2025-10-25") - date(today), "'in' d 'days'")

Time-related stuff seems very handy for planning and organization, so lacking support in Meta Bing seems like a serious omission.

math.js seems only good for simple units and idk if it can be extended to work with date/duration naturally.
On top of that, there are already multiple input field types for date/time, but no way to do anything with them on the view side.

Describe the Feature you'd like

View field type for dates/durations, or two separate field types.
May use something like Luxon underneath.

Inputs: should understand (can parse) dates from date input fields, date/string properties. Extra handy if property values like [[2025-10-10]] (links to daily notes) can be parsed.
New date construction: should allow both exact date specification and natural relative definitions (now, today, yesterday, tomorrow...).
Expressions: should allow some date/time calculations (shifted date, duration between dates, ...)
Output: should allow to be presented using existing date/time widgets or formatted into a string using custom format string.

Challenges:

  • Luxon has no ready to use expression parser like in math.js and no parsing from natural strings;
  • dates and durations are two separate types that form an affine space. Existing view field grammar will likely require some compromise or added complexity to allow expressions with them.

Alternatives

Keep using Dataview.
It is being superseded by Datacore.
Dataview inline fields have some limitations.
Datacore might get its own inline fields support someday, but that's uncertain.

View field type that uses Datacore query evaluation - I don't know whether it is exposed for use by other plugins.

Some permanent extensions for math.js that would allow to work with dates as numbers in Unix time format and allow necessary formatting?

Multiline code blocks to implement my own formatting logic like shown in #584 - not an option. I need simple inline fields.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions