Giter VIP home page Giter VIP logo

Comments (10)

mpbrucker avatar mpbrucker commented on August 18, 2024 1

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.

mpbrucker avatar mpbrucker commented on August 18, 2024 1

Commenting out this line appears to correct the issue in the downloaded iCal:
image

from abe.

audreywl avatar audreywl commented on August 18, 2024

This may also have some overlap with the bug causing some (but not all) events to shift forward a minute on certain subscribed calendars:
abe long one-day example 2

from abe.

audreywl avatar audreywl commented on August 18, 2024

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.

newsch avatar newsch commented on August 18, 2024

@audreywl that's definitely doable, once you have a better idea of what needs to be changed we can modify the db.

from abe.

newsch avatar newsch commented on August 18, 2024

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.

audreywl avatar audreywl commented on August 18, 2024

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.

kylecombes avatar kylecombes commented on August 18, 2024

If it is a rounding error, I think it should be handled on the backend.

from abe.

kylecombes avatar kylecombes commented on August 18, 2024

Omitting DTEND shouldn't break anything on the frontend. I'd vote for that route.

from abe.

mpbrucker avatar mpbrucker commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.