We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks for your great library.
I found an issue when loading apple calendar exports. the dtstart/end isn't parsed because of a tailing line feed.
Adding dt = fmt.Sprintf("%sZ", strings.TrimRight(dt, "\r\n")) to the parsing func doe fix the problem.
dt = fmt.Sprintf("%sZ", strings.TrimRight(dt, "\r\n"))
// parses the event start time func (p *Parser) parseTimeField(fieldName string, eventData string) (time.Time, string) { reWholeDay, _ := regexp.Compile(fmt.Sprintf(`%s;VALUE=DATE:.*?\n`, fieldName)) re, _ := regexp.Compile(fmt.Sprintf(`%s(;TZID=(.*?))?(;VALUE=DATE-TIME)?:(.*?)\n`, fieldName)) resultWholeDay := reWholeDay.FindString(eventData) var t time.Time var tzID string if resultWholeDay != "" { // whole day event modified := trimField(resultWholeDay, fmt.Sprintf("%s;VALUE=DATE:", fieldName)) t, _ = time.Parse(IcsFormatWholeDay, modified) } else { // event that has start hour and minute result := re.FindStringSubmatch(eventData) if result == nil || len(result) < 4 { return t, tzID } tzID = result[2] dt := result[4] if !strings.Contains(dt, "Z") { dt = fmt.Sprintf("%sZ", strings.TrimRight(dt, "\r\n")) } t, _ = time.Parse(IcsFormat, dt) } return t, tzID }
The text was updated successfully, but these errors were encountered:
Thanks for the feedback @threez! Can you open a PR with the change and tests?
Sorry, something went wrong.
fixes PuloV#32
405e841
fix to be able to load apple calendars
Hi @PuloV I added the code and a test.
No branches or pull requests
Thanks for your great library.
I found an issue when loading apple calendar exports. the dtstart/end isn't parsed because of a tailing line feed.
Adding
dt = fmt.Sprintf("%sZ", strings.TrimRight(dt, "\r\n"))
to the parsing func doe fix the problem.The text was updated successfully, but these errors were encountered: