Skip to content

Commit

Permalink
fix issue #53, google-ics german Umlaut not converted
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerjoss committed Sep 1, 2022
1 parent 720f3f5 commit 95646cd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.3.3
## 09/01/2022

1. [](#bugfix)
* fix issue #53, google-ics german Umlaut not converted

# v0.3.2
## 04/15/2022

Expand Down
13 changes: 13 additions & 0 deletions assets/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ function whenJqReady() {
url: calendarUrl,
//dataType: "json", //no need. if you use crossOrigin, the dataType will be override with "json"
//charset: 'ISO-8859-1', //use it to define the charset of the target url
//contentType: "application/json; charset=ISO-8859-1", // test encoding, geht nicht 31.08.22
context: {},
success: function(data) {
// alert(data);
Expand All @@ -254,6 +255,13 @@ function whenJqReady() {
var fcevents = {};
// fcevents["tzid"] = icsTimezone;
var entry = item.getFirstPropertyValue("summary");
// console.log('Entry: ', entry);
// fix badly encoded Text from remote google calendars 01.09.22
try { // see https://stackoverflow.com/questions/5396560/how-do-i-convert-special-utf-8-chars-to-their-iso-8859-1-equivalent-using-javasc
entry = decodeURIComponent(escape(entry));
} catch(e) {
entry = entry;
}
if (entry !== null) fcevents["title"] = entry;
var entry = item.getFirstPropertyValue("location");
if (entry !== null) fcevents["location"] = entry;
Expand Down Expand Up @@ -284,6 +292,11 @@ function whenJqReady() {
fcevents["allDay"] = true; // default value -> span .fc-time in grid is NOT created
if (duration < 86400000) fcevents["allDay"] = false; // duration less than 1 day: allDay = false
var entry = item.getFirstPropertyValue("description"); // add description 22.06.20
try { // see https://stackoverflow.com/questions/5396560/how-do-i-convert-special-utf-8-chars-to-their-iso-8859-1-equivalent-using-javasc
entry = decodeURIComponent(escape(entry));
} catch(e) {
entry = entry;
}
if (entry !== null) fcevents["description"] = entry;
var entry = item.getFirstPropertyValue("color"); // add color from ics
if (entry !== null) fcevents["color"] = entry;
Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: FullCalendar
version: 0.3.2
version: 0.3.3
description: show Calendar Widget from ICS File(s), based on fullcalendar.io
icon: calendar
author:
Expand Down

0 comments on commit 95646cd

Please sign in to comment.