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

Timetable import and export feature #55

Conversation

alexiscatnip
Copy link

@alexiscatnip alexiscatnip commented Oct 23, 2018

  • import working, export working.
  • Export: Can be imported by google calendar, and show up as events in a single week (currently bugged.)
  • Change build.gradle to add 'biweekly' as dependency

NOTE: I changed build.gradle to have an extra dependency: biweekly. This has not been reflected in UG/DG/docs yet.

… work.

Instructions on biweekly's git not clear for noob. Not sure what I am doing here. Not enough handholding.
…so Created function for export in IcsUtil.

Also created additional functions in TimeSlot and TimeTable classes to get some of their data easily.
-Can now export the timetable, but the format of the exported .ics file is incomplete and broken! :(
Export function now works, and can be imported back it after being exported! :D
nianfei97
nianfei97 previously approved these changes Oct 23, 2018
Copy link

@nianfei97 nianfei97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Quite amazing that you managed to migrate over to the new library in just a few days. Also, it looks like my concerns of not having enough lines of code to write isn't really a concern.

* 2) Also used during import and export commands (ie, read and write)
*
* NOTE: Only support ICS to-and-from TimeTable Objects(!!).
* TODO: allow conversion to objects other than timetable

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I don't think there's a need to convert anything else to .ics format...

What other things were you thinking about?

*
* NOTE: Only support ICS to-and-from TimeTable Objects(!!).
* TODO: allow conversion to objects other than timetable
* TODO: create a 'serialisable' class to serialise(?) the timetable objects to ics file formats

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think "serializable" actually has any special meaning lol, so I don't think this is necessary

private static IcsUtil instance;

private IcsUtil(){
//any things to initialise?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not

LocalTime timeSlotEndTime = timeStringToLocalTime(timeEndStr);
DayOfWeek timeSlotDay = dateStringToDayOfWeek(dateStartStr);

System.out.println(timeSlotStartTime + " to " + timeSlotEndTime + " on " + timeSlotDay + ": " + summaryStr);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to remove this xd

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah of course XD oops.

@nianfei97 nianfei97 merged commit 9d79ce6 into CS2113-AY1819S1-W13-1:master Oct 23, 2018
@alexiscatnip alexiscatnip deleted the timetable_storage_as_ics_branch branch November 4, 2018 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.high Must do status.complete The pull request is ready to be merged type.story A user story
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants