diff --git a/components.go b/components.go index a29de5f..211acb6 100644 --- a/components.go +++ b/components.go @@ -197,7 +197,7 @@ func dateFormatForTime(t time.Time, props []PropertyParameter) (string, []Proper if l != nil { ls = l.String() } - if (l == time.UTC /* || ls == "MST"*/ || l == nil) && tzid == nil { + if (l == time.UTC /* || ls == "MST"*/ || ls == "") && tzid == nil { layout = icalDateFormatUTC } else if tzid == nil && l != time.Local /* && ls != "MST"*/ { props = append(props, WithTZID(ls)) @@ -213,7 +213,7 @@ func timestampFormatForTime(t time.Time, props []PropertyParameter) (string, []P if l != nil { ls = l.String() } - if (l == time.UTC || /*ls == "MST" ||*/ l == nil) && tzid == nil { + if (l == time.UTC || /*ls == "MST" ||*/ ls == "") && tzid == nil { layout = icalTimestampFormatUTC } else if tzid == nil && l != time.Local /* && ls != "MST"*/ { props = append(props, WithTZID(ls)) diff --git a/components_test.go b/components_test.go index a808210..c637df6 100644 --- a/components_test.go +++ b/components_test.go @@ -11,7 +11,7 @@ import ( ) func TestSetDuration(t *testing.T) { - date, _ := time.Parse(time.RFC822, time.RFC822) + date, _ := time.Parse(time.RFC822Z, time.RFC822Z) duration := time.Duration(float64(time.Hour) * 2) testCases := []struct { @@ -181,7 +181,7 @@ END:VEVENT for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - if dateSpecificLocationNotLocal.Location().String() == "MST" { + if tc.start.Location().String() == "MST" || tc.end.Location().String() == "MST" { t.Skipf("No idea why we are getting MST -- Help?") }