diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-06-23 01:39:08 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-06-23 01:39:08 +0200 |
commit | 327b322b9583f760cd02ddad7a2a8890df26cc8b (patch) | |
tree | d0a73d5df0011233f3eaa5d9a54d1317fad50bbc /module/calp/html/vcomponent.scm | |
parent | Minor cleanup in recurrence generate. (diff) | |
download | calp-327b322b9583f760cd02ddad7a2a8890df26cc8b.tar.gz calp-327b322b9583f760cd02ddad7a2a8890df26cc8b.tar.xz |
workuid-stuff-2
Diffstat (limited to 'module/calp/html/vcomponent.scm')
-rw-r--r-- | module/calp/html/vcomponent.scm | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 1cee47a5..472a8c2b 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -112,7 +112,9 @@ (class ,(when (and (prop ev 'PARTSTAT) (eq? 'TENTATIVE (prop ev 'PARTSTAT))) " tentative ")) - (data-uid ,(output-uid ev))))) + ,@(when (repeating? ev) + `((data-instance ,(datetime->string (as-datetime (prop ev 'DTSTART)))))) + (data-uid ,(prop ev 'UID))))) (div (@ (class "vevent eventtext summary-tab")) (h3 ,(fmt-header (when (prop ev 'RRULE) @@ -293,7 +295,10 @@ extra-attributes `((id ,(html-id ev) "-block") (data-calendar ,(base64encode (or (prop (parent ev) 'NAME) "unknown"))) - (data-uid ,(output-uid ev)) + (data-uid ,(prop ev 'UID)) + ;; TODO write helper for this (re-occuring) case + ,@(when (repeating? ev) + `((data-instance ,(datetime->string (as-datetime (prop ev 'DTSTART)))))) (class "vevent event" ,(when (and (prop ev 'PARTSTAT) @@ -352,29 +357,6 @@ (prop event 'RRULE))))) -;; Return a unique identifier for a specific instance of an event. -;; Allows us to reference each instance of a repeating event separately -;; from any other -(define-public (output-uid event) - (string-concatenate - (cons - (prop event 'UID) - (when (repeating? event) - ;; TODO this will break if a UID already looks like this... - ;; Just using a pre-generated unique string would solve it, - ;; until someone wants to break us. Therefore, we just give - ;; up for now, until a proper solution can be devised. - (list "---" - ;; TODO Will this give us a unique identifier? - ;; Or can two events share UID along with start time - (datetime->string - (as-datetime (or - ;; TODO What happens if the parameter RANGE=THISANDFUTURE is set? - (prop event 'RECURRENCE-ID) - (prop event 'DTSTART))) - "~Y-~m-~dT~H:~M:~S")))))) - - (define (week-day-select args) `(select (@ ,@args) (option "-") @@ -476,7 +458,9 @@ ;; (hr) - (input (@ (type "submit"))) + (input (@ (type "submit") (data-key "this") (value "This"))) + (input (@ (type "submit") (data-key "this_future") (value "This & Future"))) + (input (@ (type "submit") (data-key "all") (value "All"))) )))) ;; description in sidebar / tab of popup |