-
-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Labels
Description
ComponentBase.getTimeProp
will return times in the time.Local
location when time zone information is not present in the ics. This may be fine for a simple program parsing a calendar. But when a HTTP handler parses calendars on behalf of clients this will almost certainly be wrong and break time comparisons in subtle ways. Rather the client's time zone should be used, if available. Failing that it shoud be clearer that some assumption may need to be made by the developer writing the handler.
I propose adding a new constructor similar to time.ParseInLocation
:
func ParseCalendarInLocation(r io.Reader, time.Location) (*Calendar, error)
The location will be stored as an unexported variable in Calendar
and used for all assuptions.
ParseCalendar
shall then simply return this:
func ParseCalendar(r io.Reader) (*Calendar, error) {
return ParseCalendarInLocation(r, time.Local)
}