bastibe / org-journal

A simple org-mode based journaling mode
BSD 3-Clause "New" or "Revised" License
1.24k stars 123 forks source link

fails to create a time entry if -property-timestamp-format has the time ("%H:%M") in it. #373

Closed dppdppd closed 2 years ago

dppdppd commented 2 years ago

Describe the bug org-journal seems to choke if the time is in org-journal-created-property-timestamp-format

It creates the level 1 date heading, with correct CREATED property, but fails to create the level 2 time heading, e.g.,

  • 2022-01-02 :PROPERTIES: :CREATED: [2022-01-02 Sun 00:17] :END:

The error printed is

user-error: Created property timestamp format "[%Y-%m-%d %a %H:%M]" doesn’t match CREATED property value ([2022-01-02 Sun 00:09]) from entry at line: Line 1

To Reproduce set org-journal-created-property-timestamp-format to "[%Y-%m-%d %a %H:%M]"

Expected behavior That a time heading be created without error

Desktop (please complete the following information):

Your Emacs Configuration

(use-package! org-journal :defer t :custom (org-journal-dir (concat org-root "/journal/")) (org-journal-file-format "%Y-%m.org") (org-journal-file-type 'monthly) (org-journal-date-format "%Y-%m-%d") (org-journal-created-property-timestamp-format "[%Y-%m-%d %a %H:%M]") (org-journal-encrypt-journal t))

dppdppd commented 2 years ago

I cannot isolate the conditions under which this happens. This might be the result of having mixed CREATED property formats. Since I cannot isolate the issue, I've closed it for now.

bastibe commented 2 years ago

This might be some sort of locale issue. I have seen similar issues with timestamp parsing in the past. It might even be a subtle difference between Emacs on Windows and Linux/WSL, potentially.

dppdppd commented 2 years ago

I removed the time from the format and it no longer errors. I’ll try to repro on macOS.