Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neorg update-metadata does not use custom datetime format from core.esupports.metagen config #865

Closed
2 tasks done
dasupradyumna opened this issue May 12, 2023 · 1 comment · Fixed by #883
Closed
2 tasks done
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@dasupradyumna
Copy link

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

NVIM v0.10.0-dev

Neorg setup

require('neorg').setup {
    load = {
      ['core.defaults'] = {},
      ['core.completion'] = { config = { engine = 'nvim-cmp' } },
      ['core.dirman'] = { config = { workspaces = { journal = '~/journal', rrc = '~/RRC' } } },
      ['core.esupports.metagen'] = {
        config = {
          tab = '  ',
          template = {
            { 'title', function() return vim.fn.expand '%:t:r' end },
            { 'description', '' },
            { 'author', 'dasu pradyumna' },
            { 'categories', '' },
            { 'created', function() return os.date '%d %b %Y %H:%M' end },
            { 'updated', function() return os.date '%d %b %Y %H:%M' end },
            -- { 'version', require('neorg.config').norg_version }, -- error here, why?
          },
          update_date = false, -- BUG: "update-metadata" uses default datetime format (not config)
        },
      },
    },
  }

Actual behavior

Neorg inject-metadata respects the datetime format provided in config, and it works as expected. But update-metadata seems to be hardcoded to use the default datetime format.

After running Neorg inject-metadata -
bug_neorg_metagen_datetime

After running Neorg update-metadata -
bug_neorg_metagen_datetime2

Expected behavior

update-metadata should behave like inject-metadata and respect custom datetime format in user config.

Steps to reproduce

  1. Open a norg file in NeoVim.
  2. Execute Neorg inject-metadata.
  3. Execute Neorg update-metadata.
  4. created and updated times will have different formats.

Potentially conflicting plugins

None

Other information

No response

Help

Yes, but I don't know how to start. I would need guidance (check question below)

Implementation help

Ensure that update-metadata respects the datetime format from core.esupports.metagen's config.template[6].

@dasupradyumna dasupradyumna added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label May 12, 2023
@github-project-automation github-project-automation bot moved this to added-updated-reopened in sorting neorg issue tracker May 12, 2023
@katawful
Copy link
Contributor

katawful commented May 17, 2023

Please try #882

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
2 participants