aboutsummaryrefslogtreecommitdiff
path: root/module/calp/html/view/small-calendar.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-08-23 23:22:10 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-08-23 23:22:10 +0200
commitedaf758b80fed1f5f14cd4b192e661c8863e84bc (patch)
tree9baf17c11a6254e81f29a1c473e5eb86c072aa79 /module/calp/html/view/small-calendar.scm
parentAdd rendering of standalone small-cal. (diff)
downloadcalp-edaf758b80fed1f5f14cd4b192e661c8863e84bc.tar.gz
calp-edaf758b80fed1f5f14cd4b192e661c8863e84bc.tar.xz
Move html modules under calp.
Diffstat (limited to 'module/calp/html/view/small-calendar.scm')
-rw-r--r--module/calp/html/view/small-calendar.scm19
1 files changed, 19 insertions, 0 deletions
diff --git a/module/calp/html/view/small-calendar.scm b/module/calp/html/view/small-calendar.scm
new file mode 100644
index 00000000..80cbbaf2
--- /dev/null
+++ b/module/calp/html/view/small-calendar.scm
@@ -0,0 +1,19 @@
+(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))
+ )
+
+(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-
+ ))
+ (if standalone
+ (xhtml-doc
+ (head (title ,(date->string month "~1"))
+ ,(include-css "/static/smallcal.css"))
+ (body ,table))
+ table))