RPIForge / website

The Forge's website - tracks machine usage and calculates charges.
GNU Affero General Public License v3.0
5 stars 10 forks source link

Calendar #13

Open wave100 opened 4 years ago

wave100 commented 4 years ago

The old website uses an embedded Google Calendar widget that doesn't play very well with our custom styling. We're going to replace it with a link to the Google Calendar API, which we'll query whenever we need to display calendar data.

We need somebody proficient with frontend dev to handle displaying calendar data, and somebody more familiar with backend to integrate the API.

wave100 commented 4 years ago

Additionally, we want to display an overview that looks something like this on the site's home page:

Forge Hours
Sun 12P-6P
Mon 9A-7P
Tue 9A-12P, 3P-8P
(and so on)
wave100 commented 4 years ago

Assigning @linkoep for backend and @michael-comstock for frontend.

HonakerM commented 4 years ago

@linkoep and @wave100 I don't recommend using the google api as it does not handle reoccuring events neatly as reoccurring events are stored inside the original event. And the API doesn't have any good accessor methods.

[EDIT] I don't know if there is any better alternative to be honest though

wave100 commented 4 years ago

Sorry for the late response, busy week - I don't think there's an alternative, unfortunately. I'd go about this by making a class in the backend that talks to Google's API and then translates it to something nicer for the frontend.

HonakerM commented 4 years ago

@linkoep @michael-comstock I was going to lay down some helper classes in util.py as I have used the google calendar api quite a bit for the forge door and some code can transfer. I will be doing this in the calendar_update branch.

I added a google_calendar class that all you need to do is initialize the class and then call list_events that takes two datetime objects a min and a max time. It returns an array of dicts object. The dictionary has start, end, and summary variables.

wave100 commented 4 years ago

We've got an hours page that displays a standard embedded calendar, so I'm calling this low priority.