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

The template does not seem to apply to the slurp property. #33

Closed
froses opened this issue May 19, 2024 · 6 comments
Closed

The template does not seem to apply to the slurp property. #33

froses opened this issue May 19, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@froses
Copy link

froses commented May 19, 2024

Hi,

The template does not seem to apply to the “slurp” property. My template is d|YYYYYYY-MM-DD HH:mm but Slurp generates 2024-05-19T08:21:08.450Z. Furthermore, the time is not correct either. At the time of the capture, it was 10:21. I guess it doesn't consider my time zone (Spain) which is GMT +2.

Thanks for your excellent work!

FRA

@inhumantsar
Copy link
Owner

thanks for the report! there's a few things to unpack here:

  • slurped template settings were indeed being ignored. it's a unique property in that it is only ever using the default and default values weren't run through format parsing. the fix for that will be in the next release.
  • d|YYYYYYY-MM-DD HH:mm doesn't seem like a valid format. Years typically have 1, 2, or 4 Ys. this format string will yield a result like +0020242024-05-19 12:31. though if that's what you're after then nevermind!
  • timezone-aware dates are finicky in javascript at the best of times. for example, on my linux machine the slurped value is my local time but it's GMT on my windows machine. obsidian complicates matters further. if you set the slurped property to a date type in obsidian it will attempt to format it according to obsidian's settings. i spent a lot of time trying to manage those differences early on. i gave up in the end though since so much of it is client specific and it's somewhat tangential to the goal of slurping pages. i would instead recommend playing with the format template (eg: adding Z to the template to indicate that it's a GMT time and letting Obsidian format it accordingly, or using the L and LT format strings to tell Moment to use locale specific formats).

thanks again for the report, i should be able to publish an update later today with the template fix in it. let me know if you still have trouble with it after updating.

@inhumantsar inhumantsar added the bug Something isn't working label May 19, 2024
@inhumantsar inhumantsar self-assigned this May 19, 2024
@froses
Copy link
Author

froses commented May 20, 2024

Hi,

Sorry d|YYYYYYY-MM-DD HH:mm is a typo…

And yes, time zones are a headache. I will follow your advice. Thank you so much.

Thanks!

FRA

@inhumantsar
Copy link
Owner

no problem! keep your eyes peeled for that update. i have one or two other things to put into this release but it'll be out soon. i'll leave this issue open until it's out and you have a chance to test it

@froses
Copy link
Author

froses commented May 21, 2024 via email

inhumantsar added a commit that referenced this issue Jun 8, 2024
- fix: strip hash marks from file names (#20)
- fix: clean and dedupe tags (#23 #27)
- fix: ensure slurpedTime is formatted with its settings template (#33)
@inhumantsar
Copy link
Owner

sorry that took so long to release! should be fixed in 0.1.12

@froses
Copy link
Author

froses commented Jun 10, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants