python-gsoc / python-blogs

Python Software Foundation GSoC Blog Platform. This system was used until 2024 but is no longer maintained.
http://python-gsoc.org/
GNU Affero General Public License v3.0
41 stars 60 forks source link

GSoC 2019 - Create calendar page element #38

Closed botanicvelious closed 5 years ago

botanicvelious commented 5 years ago

This task is to make a template tag item that will display the calendar in the local time of the user. There are 2 examples below, you would need to support the entire list of timezones.

GMT -7 MST example

<iframe src="https://calendar.google.com/calendar/embed?showTitle=0&amp;showPrint=0&amp;showCalendars=0&amp;height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=uhambjin8qdb9af4vt03c4djg4%40group.calendar.google.com&amp;color=%23853104&amp;ctz=America%2FDenver" style="border-width:0" width="800" height="600" frameborder="0" scrolling="no"></iframe>

GMT -8 PST example

<iframe src="https://calendar.google.com/calendar/embed?showTitle=0&amp;showPrint=0&amp;showCalendars=0&amp;height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=uhambjin8qdb9af4vt03c4djg4%40group.calendar.google.com&amp;color=%23853104&amp;ctz=America%2FLos_Angeles" style="border-width:0" width="800" height="600" frameborder="0" scrolling="no"></iframe>

Basically just need to change the value of "ctz="

to get and set the timezone see https://docs.djangoproject.com/en/2.1/topics/i18n/timezones/

Saurabh-Singh-00 commented 5 years ago

So it should be something like? :- {% load ctz %}

<iframe src="https://calendar.google.com/calendar/embed?showTitle=0&amp;showPrint=0&amp;showCalendars=0&amp;height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=uhambjin8qdb9af4vt03c4djg4%40group.calendar.google.com&amp;color=%23853104&amp;ctz={% ctz %}" style="border-width:0" width="800" height="600" frameborder="0" scrolling="no"></iframe>

botanicvelious commented 5 years ago

Exactly!

Saurabh-Singh-00 commented 5 years ago

Working on this issue.

MastersAbh commented 5 years ago

So, the user shouldn't be provided with the option to give anything as input ? Instead, we need to form a logic to detect and display in his/her timezone?

botanicvelious commented 5 years ago

That is correct, the users timezone should be auto detected

Saurabh-Singh-00 commented 5 years ago

So, the user shouldn't be provided with the option to give anything as input ? Instead, we need to form a logic to detect and display in his/her timezone?

That would be too easy option to go with. Then we only need a drop-down to select timezones.

botanicvelious commented 5 years ago

We do not want the user to have to select the timezone, it should be automatic.