aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/time.odin15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/time.odin b/src/time.odin
index 853aa95..468f5d8 100644
--- a/src/time.odin
+++ b/src/time.odin
@@ -385,6 +385,10 @@ importICS :: proc(path: string) -> ([dynamic]Timeblock, bool) {
}
for line in strings.split_lines_iterator(&content) {
+
+ // BUG: This assumes that there will never be a line shorter than 10.
+ // That means this will try reading out of bounds at some point.
+
if line[0:10]=="DTSTART;TZ" {
// grab the timestamp from the end of the line, and set start to it
@@ -436,12 +440,21 @@ importICS :: proc(path: string) -> ([dynamic]Timeblock, bool) {
c.end.year = strconv.atoi(line[ll-15:ll-11])
}
+
+ // TODO: This is checking if the years are 0 to make sure it hasn't read from
+ // from a line containing "DTSTART;VALUE" instead of "DTSTART;TZID"
+ // VALUE days are events that are set to last the entire day,
+ // as opposed to having a defined start and end point.
+ //
+ // This should eventually not be needed, because these days
+ // should also be imported based on the session's default-day settings
+
if line=="END:VEVENT" && (c.end.year != 0) && (c.start.year != 0) {
fmt.println(line)
c.value = 1
append(&output, c)
+
blank_timeblock: Timeblock
-
c = blank_timeblock
fmt.println("\n\n", i, line_nr, "\n\n")