aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/validate.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/vcomponent/validate.scm')
-rw-r--r--module/vcomponent/validate.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/module/vcomponent/validate.scm b/module/vcomponent/validate.scm
new file mode 100644
index 00000000..8881c95f
--- /dev/null
+++ b/module/vcomponent/validate.scm
@@ -0,0 +1,16 @@
+(define-module (vcomponent validate)
+ :use-module (vcomponent)
+ :use-module (datetime)
+ :use-module ((hnh util exceptions)
+ :select (warning))
+ :use-module (calp translation)
+ :export (validate-event))
+
+(define (validate-event component)
+ (unless (date/-time<=
+ (prop component 'DTSTART)
+ (prop component 'DTEND))
+ (warning (G_ "end (~a) must be equal to or greater than start (~a)")
+ (prop component 'DTEND)
+ (prop component 'DTSTART)))
+ )