4

If you look a the screenshot the cursor is locked in the echo area. If want to select the date, I have to click on one with the mouse. Do I, or there is a way to do with the keyboard?

EDIT:

Also the navigation key bindings don't work as they're supposed to. If I do C-f, it does not move one day forward whether in conjunction with Shift or not.

Screenshot

  • 2
    The words "Date+time" come from the function org-read-date in the org.el library. I have added the tag org-mode to the question so people do not mistakenly think this is strictly relating to the calendar library. For anyone who wishes to work on this question, evaluate (require 'org) and then evaluate (org-read-date) .... – lawlist Nov 13 at 19:11
4

Hold down the shift key while you use the arrows. Shift-right and left will move by days. Alt-Shift right and left will move by months, and Alt-Shift up and down will move by years.

  • The key bindings are provided by org-read-date-minibuffer-local-map. – xuchunyang Nov 13 at 19:35
3

There is a lot of inputs you can give to specify a date or time. The whole overview is here. Just some notable examples:

  • Relative dates:
    • +1 or just +: tomorrow
    • +1w: next week
    • sat: next saturday
  • Absolute dates are a bit weird. It uses ISO YMD format by default: 3-2-5 expands to 2003-02-05. I prefer to use 23 jan 19 or 23 jan 2019 (equal to 19-1-23) to use a DMY format.
  • To add a time to any date selection use 11am or 11:00

Some Calendar movements also work. Shift+Arrows moves by days. > and < shift the months displayed, ... See Calendar motion and Scroll calendar of the Emacs Calendar manual.

Here's a screenshot where I select the monday in two weeks at 11am by entering +2mon 11am. The date prompt gets updated to indicate my selected date => <2019-11-25 Mon 11:00>. Press Enter to confirm and exit.

date selection example

  • About the Calendar motion: g d Move point to specified date (calendar-goto-date). I don't know what key combo g d is. – Erwann Nov 13 at 19:57
  • Are you supposed to type +1w in the echo area? – Erwann Nov 13 at 19:59
  • Yes, just type it. The displayed date in the echo area should change and you can confirm with Enter. Commands like C-a, C-f or single letters do not work as they are intercepted by the minibuffer. – fpiper Nov 13 at 20:03
  • OK, it worked. Is the minibuffer the same as the echo area? – Erwann Nov 13 at 20:15
2

@Daniel's answer should be the official solution. But I find you can still just C-x o to move the cursor to the calendar buffer, then move around as usual and hit RET to pick a date. Though you will not see the cursor because the org mode turns it off, you can get it back via M-x (setq cursor-type t).

  • @xuchungyang C-x o switches to buffer from which I did C-c C-s, not the calendar, in my case. – Erwann Nov 13 at 19:48
  • @Erwann You probably have switched to the calendar buffer, though you don't notice since the cursor is hided as I explained in the last sentence. – xuchunyang Nov 13 at 19:59
  • @xuchungyang, the whole sequence. 1) starting from "original buffer": C-c C-s, opens calendar, cursor in echo area. 2) C-x o, cursor flickers in original buffer. 3) M-x prompts: command attempted to use minibuffer while in minibuffer. – Erwann Nov 13 at 20:05
  • 2
    @Erwann C-x o runs other-window. In this case, there are at least THREE windows, that is, the minibuffer window, the org mode file buffer window and the calendar buffer window. So use C-x o to switch to the calendar buffer window. You might need to use C-x o more than once. – xuchunyang Nov 13 at 20:35
  • @xuchunyang: you should porbably add your last comment into the answer. – NickD Nov 14 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.