Skip to content

Commit

Permalink
fix: fixed GEO missing when supplied (closes #569)
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism authored Feb 14, 2024
1 parent 9190c84 commit 2eeceb8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ export default class ICalEvent {
return this;
}
if (
(location && !location.title) ||
(!location?.title &&& !location?.geo) ||
(location?.geo && (!isFinite(location.geo.lat) || !isFinite(location.geo.lon)))
) {
throw new Error(
Expand Down Expand Up @@ -1766,13 +1766,14 @@ export default class ICalEvent {
':geo:' + escape(this.data.location.geo?.lat, false) + ',' +
escape(this.data.location.geo?.lon, false) + '\r\n';
}

if (this.data.location.geo) {
g += 'GEO:' + escape(this.data.location.geo?.lat, false) + ';' +
escape(this.data.location.geo?.lon, false) + '\r\n';
}
}

// GEO
if (this.data.location.geo) {
g += 'GEO:' + escape(this.data.location.geo?.lat, false) + ';' +
escape(this.data.location.geo?.lon, false) + '\r\n';
}

// DESCRIPTION
if (this.data.description) {
g += 'DESCRIPTION:' + escape(this.data.description.plain, false) + '\r\n';
Expand Down

0 comments on commit 2eeceb8

Please sign in to comment.