-
Notifications
You must be signed in to change notification settings - Fork 357
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
Should not allow setting both duration and end_time #120
Comments
Really? Do you honestly think that this is enough information for anyone to be able to fulfill this issue? How about an explanation? I'm going to just guess what you're talking about here: The end_time is not the end time of the occurrence, it's the end time of the schedule. The duration describes how long each occurrence happens for. Hence they are two distinct things. |
@jfelchner end_time should be the end time of first occurrence. If you set both duration and end_time, they are in conflict. Even if end_time was the end time of the schedule (which would be the end time of the last occurrence in the schedule), wouldn't that be in conflict? |
@dlee You are correct. schedule = IceCube::Schedule.new Time.utc(2012, 10, 1, 12, 0, 0)
schedule.end_time = Time.utc(2012, 12, 1, 12, 0, 0)
schedule.duration = 3600
schedule.to_ical
#=> DTSTART:20121001T120000Z\nDURATION:PT1H\nDTEND:20121201T120000Z According to the iCal spec, DTEND is the end time of the first occurrence and is what the duration is calculated from:
Therefore they should be mutually exclusive. |
Additionally I feel as though calling |
@dlee it looks like your issues are all follow-ups to the changes introduced in #99. I have some fixes for it in my fork, can we get some consensus on the proposed changes?
In my current version:
|
* schedule.end_time attribute controls duration. * preference is given to :end_time over :duration for initializing. * to_ical outputs only DTEND instead of DURATION. * to_hash outputs only :end_time. Issue ice-cube-ruby#120
* schedule.end_time attribute controls duration. * preference is given to :end_time over :duration for initializing. * to_ical outputs only DTEND instead of DURATION. * to_hash outputs only :end_time. Issue ice-cube-ruby#120
* schedule.end_time attribute controls duration. * preference is given to :end_time over :duration for initializing. * to_ical outputs only DTEND instead of DURATION. * to_hash outputs only :end_time. Issue ice-cube-ruby#120
Schedule should not allow setting both duration and end_time.
The text was updated successfully, but these errors were encountered: