Below is my own solution to the question.
calendar-iso-to-absolute
and calendar-gregorian-from absolute
converts the list (year week weekday)
to the list (month day year)
which is transformed to (0 0 0 day month year)
and processed by encode-time
. The result is an elisp time value that can be processed by format-time
.
Example:
(format-time-string "%F" (iso-week-to-time 2018 32 1)) % Monday week 32 in 2018
"2018-08-06"
There should be simpler solutions as this is a kludge, especially the permutation of the list.
(defun iso-week-to-time(year week day)
"Convert ISO year, week, day to elisp time value."
(apply #'encode-time
(append '(0 0 0)
(-select-by-indices
'(1 0 2)
(calendar-gregorian-from-absolute (calendar-iso-to-absolute
(list week day year)))))))
(defun iso-beginning-of-week(year week)
"Convert ISO year, week to elisp time for first day (Monday) of week."
(iso-week-to-time year week 1))
(defun iso-end-of-week(year week)
"Convert ISO year, week to elisp time for last day (Sunday) of week."
(iso-week-to-time year week 7))