question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Dates in Filename not parsed

See original GitHub issue

Describe the bug Using Capture To I’m trying to log the current file to my Daily Note. My date format does show up properly in settings for QuickAdd but it doesn’t actually parse into a date. Instead it shows up in my Daily notes as {{YYYY-MM-DD}} and the note I’m trying to log does not get logged into the file either.

Console error:

QuickAdd: (LOG) TemplaterError: Invalid reference date format, try specifying one with the argument 'reference_format' VM133:15096

Setup of Capture To: Screen Shot 2021-10-13 at 7 11 09 AM

Screen Shot 2021-10-13 at 7 12 41 AM

To Reproduce Steps to reproduce the behavior:

  1. Setup Quick Add as described
  2. Run Action
  3. See file created but not with proper date format and not with link to the file I was currently active in
  4. See error

Expected behavior I expect that Quick Add will create the file if it doesn’t exist and then log the link to the current file after the Reading heading.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS, iPadOS 15
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: M1 iPad Pro
  • OS: 15.0.1
  • Browser Stock Safari
  • Version latest

Additional context Templater also shows an error at the same time, but that may be because it’s looking at the file name to get the date it wants to parse into the variables and {{YYYY-MM-DD}} isn’t a valid date.

Screen Shot 2021-10-13 at 7 01 48 AM

Possibly Related:

https://github.com/chhoumann/quickadd/issues/119

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
curtismchalecommented, Oct 28, 2021

I’m not seeing these problems now after a few days of testing so…gremlins I guess.

1reaction
chhoumanncommented, Oct 20, 2021

Can i take a look at your template, I feel that your template may be the cause of the problem

Agreed, it could very well be the template. I tried to recreate it with no template, and it’s working as intended. This is potentially what’s happening: the file is created, but the Templater cannot parse the Templater code, so it fails. This exception immediately stops the QuickAdd creation process as well, so nothing is captured.

It looks like Templater is complaining about a reference date format. Here’s some more information about that: https://silentvoid13.github.io/Templater/docs/internal-variables-functions/internal-modules/date-module

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jekyll parses any dash-separated numeric filename as date
I believe this to be a bug, not a question about using Jekyll. ... Don't parse filenames as dates outside of the posts...
Read more >
[Solved] Parse through date of a filename - CodeProject
A quick solution would be to get the date string, check it's length, then switch to an appropriate parse string, one for one...
Read more >
[BUG] Parse show title and date from filename for Emby files
I'm looking for a way to have MCEBuddy ignore the dates in a file name. For example: Emby records some shows as: “Show...
Read more >
Javascript date parsing bug - fails for dates in June (??)
Save this question. Show activity on this post. I have some javascript which parses an ISO-8601 date. For some reason, it is failing...
Read more >
Extract Date from File Name - Designer - Alteryx Community
Solved: Hi, How can I extract the date from a file named "filename dd.mm.yy". I get a new file every day and the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found