Skip to content
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

End Date #66

Closed
KerenChandran opened this issue Mar 27, 2016 · 5 comments
Closed

End Date #66

KerenChandran opened this issue Mar 27, 2016 · 5 comments

Comments

@KerenChandran
Copy link

@jquense So I noticed that the end date specified isn't actually included in the span calculation. E.g. Saturday April 2, 2016 to Saturday April 9, 2016, the event spans from April 2, 2016 to April 8, 2016. Is this intended behaviour?

@jquense
Copy link
Owner

jquense commented Mar 27, 2016

the end is included, but I assume you mean that the date doesn't show up on the 9th if it ends on the 9th midnight? tbh I can't decide if this behavior makes more sense then the alternative. my initial thought is this is a bug, since if it was one minute over midnight it would show. I believe the issue is that the ceil() date function doesn't round up in the case where the date is also the floor

@jquense
Copy link
Owner

jquense commented Mar 27, 2016

On further thought I think the current behavior is correct, thinking about what the All Day rows in Week and Day view would look like for those dates, I think not having them count towards taht day, allows for easier ranges, otherwise you'd have to end dates that are just shy of midnight, or sort of odd behavior for zero width date ranges.

@KerenChandran
Copy link
Author

Hm... okay so just to confirm, you are saying that in the example code, Long Date runs from 7 to 10 and since there's no time stamp and due to the ceil function, it takes the date before instead of the current date.

I find it weird to have it end on the 9th if the user wants it to go to the 10th, but I guess on our end we can add an inclusive/exclusive so when the event is made they can check it to say its not inclusive. Shall I close this issue then since we can conclude its not a bug?

@jquense
Copy link
Owner

jquense commented Mar 27, 2016

When dealing with dates, there is just an ugly bucket of trade-offs and weighting of use cases, since, well dates are hard.

[...]it takes the date before instead of the current date

Its not so much taking the day before as it is not quite considering the exact moment the day flips as part of the range. if you were to ask "how many days does Apr 8th midnight to Apr 9th midnight span?" I would concede that "two" is an acceptable answer from a certain perspective, but that most people, i.e. the "common sense" answer is "one" and so we'd show that event as spanning one day.

I admit it gets even fuzzier when talking about the "8th to 9th 12:01am" but in that case the range actually extends into the second day. In the case of say "Apr 8th 12:00 - Apr 8th 12:00" I'd like to say that that event span no day vs 1 day. i.e it has no duration.

Ultimately I think either interpretation is "right" but the current one makes the most sense over a wider set of uses and examples. Plus you have to draw the line on some side and as I said I think just ding "apr 8th - apr 9th" is easier than "apr8th - apr8th 23:59.999", give the lack of robust API on JS date objects. I will admit that prehaps there is room for better integration with the allDayAccessor here which exists, in part, to mitigate this sort of thing.

I find it weird to have it end on the 9th if the user wants it to go to the 10th

I think you mean have it go to the 10th if you want it show on the 9th?

@KerenChandran
Copy link
Author

I think you mean have it go to the 10th if you want it show on the 9th?

Well initially, the code in events.js has Long event spanning from april 7 to april 10, so I would assume that if it ends on april 10, I would see it on the 10th. But it doesn't cause its as you said, it goes from april 7 midnight to april 10 midnight, so technically the last time you see it should be on April 9th.

In the case of say "Apr 8th 12:00 - Apr 8th 12:00" I'd like to say that that event span no day vs 1 day. i.e it has no duration.

See in my opinion it makes sense to still show the event in the month view and span it across one day. The way I look at it is, if I'm a manager and view only on month view, it should show me all the events happening on this day and the ones ending today. But hey, that's just an opinion, my opinion (Reference to MatPat's Game Theory ;).

I do understand though, its all about a person's preference and the decisions you made does make sense. Like I said, in the project I integrate the plugin, as the user enters the date I'll have it default to the normal behaviour, but if they want the event to still show on the day its ending, I'll just add 1 to the given end date so it shows across the last date. Obviously there will be some check in place to ensure one day events won't be affected with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants