aboutsummaryrefslogtreecommitdiff
path: root/module/calp/html/view/small-calendar.scm
blob: 78c7e30f218e2266f518e96fc2ce7fd684619325 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(define-module (calp html view small-calendar)
  :use-module ((calp html components) :select (xhtml-doc include-css))
  :use-module ((calp html caltable) :select (cal-table))
  :use-module ((datetime) :select (month- month+ remove-day date->string))


  :use-module ((vcomponent instance methods) :select (get-event-set))
  :use-module ((vcomponent instance) :select (global-event-object))
  )

(define-public (render-small-calendar month standalone)
  (define table (cal-table
                 start-date: month
                 end-date: (remove-day (month+ month))
                 next-start: month+
                 prev-start: month-
                 ;; TODO proper subset
                 event-stream: (get-event-set global-event-object)
                 ))
  (if standalone
      (xhtml-doc
       (head (title ,(date->string month "~1"))
             ,(include-css "/static/smallcal.css"))
       (body ,table))
      table))