Comments (10)
After doing a bit of digging, this issue appears to stem from this line:
event_end = str(int(event_end) + 1)
which is for some reason converting the end date from a string to an int, incrementing it, and converting back to a string. This appears to be a remnant of some code that appeared to correct the end dates for all-day events that didn't actually have a duration of one day. Removing this line gives:
BEGIN:VEVENT
SUMMARY:Olin Monday
UID:5978c6587412b80011ab8225
DESCRIPTION:Monday class schedule in effect for Olin\n\nNormal Friday sche
dule for Babson and Wellesley classes
DTEND;VALUE=DATE:20170930
DTSTART;VALUE=DATE:20170929
LOCATION:None
TRANSP:OPAQUE
END:VEVENT
which appears to be correct. Another thing of note: this format of DTEND
and DTSTART
works for all-day events, but another avenue that could potentially be explored for single-day all-day events is to simply omit DTEND
, which creates a single-day event as per RFC5545.
from abe.
Commenting out this line appears to correct the issue in the downloaded iCal:
from abe.
This may also have some overlap with the bug causing some (but not all) events to shift forward a minute on certain subscribed calendars:
from abe.
Dug deeper into this issue, which is primarily caused by errors with event creation on the frontend. We need to somehow fix the events already in ABE, though, and set all the seconds for all times to 00.
from abe.
@audreywl that's definitely doable, once you have a better idea of what needs to be changed we can modify the db.
from abe.
I've done some more digging, it's definitely the transfer to ics.
Using the Olin Monday that Kyle showed, the event is displayed correctly in mongodb and the GET request, but off in the iCal:
mongodb
{
"_id": ObjectId("5978c6587412b80011ab8225"),
"_cls": "Event",
"title": "Olin Monday",
"description": "Monday class schedule in effect for Olin\n\nNormal Friday schedule for Babson and Wellesley classes",
"start": ISODate("2017-09-29T04:00:00Z"),
"end": ISODate("2017-09-30T03:59:59Z"),
"allDay": true,
"visibility": "public",
"labels": [
"featured",
"academic"
],
"sub_events": [ ]
}
JSON from https://abe.olin.build/events/5978c6587412b80011ab8225
{
"_cls": "Event",
"allDay": true,
"description": "Monday class schedule in effect for Olin\n\nNormal Friday schedule for Babson and Wellesley classes",
"end": "2017-09-30 03:59:59",
"id": "5978c6587412b80011ab8225",
"labels": [
"featured",
"academic"
],
"start": "2017-09-29 04:00:00",
"sub_events": [],
"title": "Olin Monday",
"visibility": "public"
}
iCal downloaded from https://abe.olin.build/ics/?start=2017-09-29&end=2017-09-30
BEGIN:VEVENT
SUMMARY:Olin Monday
UID:5978c6587412b80011ab8225
DESCRIPTION:Monday class schedule in effect for Olin\n\nNormal Friday sche
dule for Babson and Wellesley classes
DTEND;VALUE=DATE:20170931
DTSTART;VALUE=DATE:20170929
LOCATION:None
TRANSP:OPAQUE
END:VEVENT
from abe.
So is it not a rounding error? Or is it just that it's us rounding before we send the iCal? Because I saw pretty consistent behavior of anything with >30 seconds rounding to the next minute.
from abe.
If it is a rounding error, I think it should be handled on the backend.
from abe.
Omitting DTEND
shouldn't break anything on the frontend. I'd vote for that route.
from abe.
Made a new branch to implement a simple fix - basically, now if an event is an all-day event that's less than a day in duration, it just omits the end date. Everything seems to work in the quick tests I did - a single-day event appears as:
BEGIN:VEVENT
SUMMARY:Olin Monday
UID:5978c6587412b80011ab8225
DESCRIPTION:Monday class schedule in effect for Olin\n\nNormal Friday sche
dule for Babson and Wellesley classes
DTSTART;VALUE=DATE:20170929
LOCATION:None
TRANSP:OPAQUE
END:VEVENT
This event also appears normal when imported as an iCal. And multi-day all-day events still appear as:
BEGIN:VEVENT
SUMMARY:Spring Break
UID:5a760c64e8fb6d000a5fc366
DESCRIPTION:No Olin Classes
DTEND;VALUE=DATE:20180324
DTSTART;VALUE=DATE:20180319
LOCATION:None
TRANSP:OPAQUE
END:VEVENT
from abe.
Related Issues (20)
- Remove stale git branches
- Prevent `python -m abe.sample_data` from overwriting production data
- A client should be able to find out whether it's authenticated
- The server should grant on-campus access to an off-campus client that has previously been on campus
- Some labels confer automatic public visibility
- Add protected labels
- A client must not be able to edit an event that is tagged with a protected label
- Upgrade to flask 1.0
- PUT and DELETE /labels should use id, not name HOT 1
- Non-administrators shouldn't be able to edit labels
- PUT /labels/{id} should update events when the label name changes HOT 1
- Ability to add individual events to subscriptions HOT 1
- Remove “unlabeled” label from events.label
- Consider whether events.labels and subscription.labels should be lists of references
- Allow administrative access to the POST, PUT, and DELETE methods on labels
- Set cookie for parent domain
- Tombstone events instead of deleting them
- Allow administrative access to the POST, PUT, and DELETE methods on protected events
- A client must not be able to add protected labels to an ICS subscription
- Initial Update
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abe.