[email protected] archives
 help / color / mirror / Atom feed
From: Zoey Hewll <[email protected]>
To: [email protected]
Subject: [FR] org-read-date-style
Date: Mon, 17 Feb 2025 19:08:07 +0800	[thread overview]
Message-ID: <[email protected]> (raw)

Hi all,

I have a feature request pertaining to date parsing in the date-time 
entry prompt (=C-.=).

* Motivation
The prevailing date format where I live is D/M/Y, often abbreviated to 
D/M. While I prefer Y-M-D as a persistent storage format, I naturally 
default to D/M and prefer it for data entry. Especially when entering 
recent dates (with =org-read-date-prefer-future= set to nil), which 
usually do not require the year component and therefore the unambiguous 
ISO 8601 format (Y-M-D) is slower to input in full, and does not match 
the locally conventional order (D/M) when abbreviated (M-D).

* Proposal
The =org-read-date= function understands slash-separated dates in the 
"american" format (M/D/Y and M/D). This code could be modified so that 
the parsing of slash-separated dates depends on user preference, by 
introducing a configuration variable like =calendar-date-style=, which 
I'm tentatively naming =org-read-date-style=. Like 
=calendar-date-style=, this would change the parsing of slash-separated 
dates by =org-read-date=, but it would not change the order of arguments 
passed to date-processing functions.

It would support at least =american= (M/D and M/D/Y) and =european= (D/M 
and D/M/Y) options.

* Example
By default, =org-read-date-style= would be =american=, and so the date 
"12/3" entered at the =C-.= prompt would be interpreted as December 3rd. 
If =org-read-date-style= were set to =european=, the same date input 
"12/3" would be interpreted as the 12th of March.

* Alternatives and Extensions
- =org-read-date= could simply read the value of =calendar-date-style= 
rather than introducing a new configuration item. I propose a new item 
because of the well-documented pitfalls of =calendar-date-style=.
- There could be an option to entirely forbid dates in slash-separated 
formats, if the user wishes to avoid the possibility of this kind of 
misinterpretation. I have not proposed this as I have no use for it.
- This could simply be left to each user's own configuration (i.e. 
patching the org-mode code on a per-user basis). I suspect this feature 
would help other org-mode users who habitually use D/M/Y. (side-note: I 
have not attached a patch as I am yet to complete the copyright 
assignment, but I thought the feature was worthwhile to request regardless.)

* Prior Discussion
I did a quick search over the archives to see if this had been proposed 
before, but the closest I could see to this request was 
[[https://list.orgmode.org/[email protected]/][Date/time 
prompt  parses '3-2' as 'Month-Day', can I configure it to parse it as 
'Day-Month' ?]], which does not address slash-separated dates, and 
[[https://list.orgmode.org/876322hcps.wl%[email protected]/][Date 
Prompt Bug (or Anomoly)]] which covers the same code but doesn't address 
intentionally entering D/M/Y dates.

Regards,
Zoey


             reply	other threads:[~2025-02-17 11:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-17 11:08 Zoey Hewll [this message]
2025-03-15 16:00 ` [FR] org-read-date-style Ihor Radchenko
2025-04-29 17:22   ` Ihor Radchenko
2025-05-13 14:59     ` Zoey Hewll
2025-07-13 14:32       ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).