diff options
author | San Jacobs | 2023-09-09 01:13:54 +0200 |
---|---|---|
committer | San Jacobs | 2023-09-09 01:13:54 +0200 |
commit | 15361bd995a08b3788b56289ec89dfb80ceac160 (patch) | |
tree | 76d049d342fe8dfc9fcf70eb4a3549a03f908ab5 /src | |
parent | b90fbef0a8e7acf3d4a485ca83126afc8a745828 (diff) | |
download | satscalc-15361bd995a08b3788b56289ec89dfb80ceac160.tar.gz satscalc-15361bd995a08b3788b56289ec89dfb80ceac160.tar.bz2 satscalc-15361bd995a08b3788b56289ec89dfb80ceac160.zip |
TODOs n stuff
Diffstat (limited to 'src')
-rw-r--r-- | src/time.odin | 15 |
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") |