From 345d92beb9096da34d7b2456e73884e24962556a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 19 May 2020 23:03:37 +0200 Subject: Fix recurrence display for BYMONTHDAY in YEARLY. --- module/vcomponent/recurrence/display.scm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'module/vcomponent/recurrence/display.scm') diff --git a/module/vcomponent/recurrence/display.scm b/module/vcomponent/recurrence/display.scm index be3ad774..c30a7344 100644 --- a/module/vcomponent/recurrence/display.scm +++ b/module/vcomponent/recurrence/display.scm @@ -1,3 +1,10 @@ +;;; Commentary: +;; Pretty print a recurrence rule (in Swedish). Is currently missing a +;; number of ;; edge cases, and even more concerning limited events. +;; NOTE It would be preferable if this could share as much logic as possible +;; with the "real" generator. +;;; Code: + (define-module (vcomponent recurrence display) :use-module (vcomponent recurrence internal) :use-module (util) @@ -35,10 +42,11 @@ ) groups)))) -(define (format-bymonth-day lst) +(define* (format-bymonth-day lst optional: (final-delim "&")) (list "den " (add-enumeration-punctuation - (map number->string-ordinal lst)))) + (map number->string-ordinal lst) + final-delim))) (define-public (format-recurrence-rule rrule) @@ -48,7 +56,7 @@ (case (freq rrule) [(YEARLY) (list (awhen (byday rrule) (list " " (format-byday-list it))) - (awhen (bymonthday rrule) (list " " (format-bymonth-day it))) + (awhen (bymonthday rrule) (list " " (format-bymonth-day it "eller"))) (awhen (byyearday rrule) (list " dag " (add-enumeration-punctuation it))) (awhen (bymonth rrule) -- cgit v1.2.3