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

Set content type when Firefox #62

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ics.deps.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ics.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ var ics = function(uidDomain, prodId) {
// Since some calendars don't add 0 second events, we need to remove time if there is none...
var start_time = '';
var end_time = '';
if (start_hours + start_minutes + start_seconds + end_hours + end_minutes + end_seconds != 0) {
if (start_hours + start_minutes + start_seconds + end_hours + end_minutes + end_seconds !== 0) {

Choose a reason for hiding this comment

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

That's wrong because the variables are strings. Your code will never enter the if clause. A (one possible) correct fix is: !== "000000000000". I fixed it like this: michael-maltsev@f34a6ed

Copy link
Author

Choose a reason for hiding this comment

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

@michael-maltsev Thanks for letting me know!

start_time = 'T' + start_hours + start_minutes + start_seconds;
end_time = 'T' + end_hours + end_minutes + end_seconds;
}
Expand Down Expand Up @@ -214,7 +214,7 @@ var ics = function(uidDomain, prodId) {

var blob;
if (navigator.userAgent.indexOf('MSIE 10') === -1) { // chrome or firefox
blob = new Blob([calendar]);
blob = new Blob([calendar], { type: 'text/calendar;charset=' + document.characterSet });
} else { // ie
var bb = new BlobBuilder();
bb.append(calendar);
Expand Down
4 changes: 2 additions & 2 deletions ics.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.