-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Calendar: Initial support for iCalendar format #24695
Calendar: Initial support for iCalendar format #24695
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
{ | ||
Event event; | ||
Vector<Event> events; | ||
ICalendarParserState state = ICalendarParserState::Idle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Maybe it'd be nice to move ical parsing out into a separate ICalParser class? Doesn't have to be in this PR though.
@@ -97,14 +97,82 @@ ErrorOr<Vector<Event>> EventManager::deserialize_events(JsonArray const& json) | |||
return result; | |||
} | |||
|
|||
Core::DateTime EventManager::format_icalendar_vevent_datetime(String const& parameter) | |||
{ | |||
auto invalid_datetime = Core::DateTime::create(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's nice to add a few spec comments, like e.g.
// 4.3.4 Date
// date = date-value
//
// date-value = date-fullyear date-month date-mday
// date-fullyear = 4DIGIT
// date-month = 2DIGIT ;01-12
// date-mday = 2DIGIT ;01-28, 01-29, 01-30, 01-31
// ;based on month/year
// 4.3.5 Date-Time
// date-time = date "T" time ;As specified in the date and time
// ;value definitions
// 4.3.12 Time
// time = time-hour time-minute time-second [time-utc]
// time-hour = 2DIGIT ;00-23
// time-minute = 2DIGIT ;00-59
// time-second = 2DIGIT ;00-60
// ;The "60" value is used to account for "leap" seconds.
// time-utc = "Z"
…possibly interleaved with the code. We try to make code look a lot like the specs the code implement. (See e.g. GIFWriter.cpp or any file in LibJS for examples.)
4.3.5 mentions three forms (local time, utc, and explicit timezone). Supporting the first two seems pretty easy, might as well do that, and put in an explicit comment saying the third form isn't supported yet.
b68a827
to
eb6981e
Compare
This PR adds basic support for loading iCalendar (.ics) files and parsing VEVENT properties that are currently supported by Calendar Events: summary, start and end.
eb6981e
to
271478a
Compare
This PR adds basic support for loading iCalendar (.ics) files and parsing VEVENT properties that are currently supported by Calendar Events: summary, start and end.