Skip to content

Commit 6225704

Browse files
authored
Add files via upload
1 parent cf95b43 commit 6225704

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

parse.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ func (p *Parser) parseICalLastModified(iCalContent string) time.Time {
245245
re, _ := regexp.Compile(`LAST-MODIFIED:.*?\n`)
246246
result := re.FindString(iCalContent)
247247
modified := trimField(result, "LAST-MODIFIED:")
248+
249+
if !strings.Contains(modified, "Z") {
250+
modified = fmt.Sprintf("%sZ", modified)
251+
}
252+
248253
t, _ := time.Parse(IcsFormat, modified)
249254
return t
250255
}
@@ -488,7 +493,13 @@ func (p *Parser) parseEventCreated(eventData string) time.Time {
488493
re, _ := regexp.Compile(`CREATED:.*?\n`)
489494
result := re.FindString(eventData)
490495
created := trimField(result, "CREATED:")
496+
497+
if !strings.Contains(created, "Z") {
498+
created = fmt.Sprintf("%sZ", created)
499+
}
500+
491501
t, _ := time.Parse(IcsFormat, created)
502+
492503
return t
493504
}
494505

@@ -497,7 +508,13 @@ func (p *Parser) parseEventModified(eventData string) time.Time {
497508
re, _ := regexp.Compile(`LAST-MODIFIED:.*?\n`)
498509
result := re.FindString(eventData)
499510
modified := trimField(result, "LAST-MODIFIED:")
511+
512+
if !strings.Contains(modified, "Z") {
513+
modified = fmt.Sprintf("%sZ", modified)
514+
}
515+
500516
t, _ := time.Parse(IcsFormat, modified)
517+
501518
return t
502519
}
503520

0 commit comments

Comments
 (0)