-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
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
Defaulting to time.Local is a dangerous assumption #99
Comments
@brackendawson I'm happy to accept a PR for the new constructor. I'm a little bit apprehensive about changing or removing the existing one, but perhaps making it vararg so that people could put in an option to change the location. And/Or a function comment explaining this (I have been meaning to add more and RFC details.) |
There would be no observable change to the existing constructor. I like the functional design parameter pattern, but I worry that it would hide itself too well. I'd like to make it clear to developers that the default ParseCalendar has to assume a location. Having a second constructor immediately under it with an additional required argument should cause them to question how ParseCalendar works without location information? |
These solutions are not mutually incompatible although redundant and they all take time. I definitely think a function definition is part of what ever solution we adopt. So I'm happy with both just I have my preferences but this is about the users. :P |
Spotted that #67 is related to this. |
Attempted to resolve the merge conflicts in: #101 not sure how that resolves this. |
Looks like not. I will get to this eventually I have the other PRs I want to get across the line first. |
I'll probably do something similar to what i did with the ops for this in: #106 Going to wait for that to go though |
Actually no overlap! Please review: #107 Modify or what ever gets the best results. |
ComponentBase.getTimeProp
will return times in thetime.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
:The location will be stored as an unexported variable in
Calendar
and used for all assuptions.ParseCalendar
shall then simply return this:The text was updated successfully, but these errors were encountered: