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

.ics file is not getting downloaded in internet explorer 11 #4

Closed
ghost opened this issue Jan 20, 2017 · 3 comments
Closed

.ics file is not getting downloaded in internet explorer 11 #4

ghost opened this issue Jan 20, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Jan 20, 2017

Although it is working fine in chrome

@ghost
Copy link
Author

ghost commented Jan 23, 2017

 key: 'handleDropdownLinkClick',
        value: function handleDropdownLinkClick(e) {
            e.preventDefault();
            var url = e.currentTarget.getAttribute('href');				
            if (this.state.isCrappyIE && ****(e.currentTarget.getAttribute('class') === 'ical-link' || e.currentTarget.getAttribute('class') === 'outlook-calendar-link'))**** {			
                var blob = new Blob([url], { type: 'text/calendar' });
                window.navigator.msSaveOrOpenBlob(blob, 'download.ics');
            } else {
                window.open(url, '_blank');
            }

            this.toggleCalendarDropdown();
      }

i think attributes enclosed in **** are not required, when i am removing them, i am able to download the file in ie as well

@jasonsalzman
Copy link
Owner

Sorry for the delayed response.

Thank you for bringing this to my attention. The latest build 0.0.8 fixes the problem. This has been released to NPM. Please let me know if you should have further issues.

@jimmysolanki
Copy link

function _getUrl_ics(data) {
    var startTime = formatTime(data[Count].Days);
   
    url = encodeURI(
    'data:text/calendar;charset=utf8,' + [
      'BEGIN:VCALENDAR',
      'VERSION:2.0',
      'BEGIN:VEVENT',
      'URL:' + document.URL,
      'DTSTART:' + (startTime),
      'DTEND:' + (startTime),
      'SUMMARY:' + (data[Count].TaskName || ''),
      'DESCRIPTION:' + (''),
      'LOCATION:' + (''),
      'END:VEVENT',
      'END:VCALENDAR'].join('\n'));
    var IsIE = false;
    if ((navigator.userAgent.indexOf("MSIE") != -1) || (!!document.documentMode == true)) //IF IE > 10
    {
        IsIE = true;
    }
    if (IsIE) {
        
        var blob = new Blob([url], { type: 'text/calendar' });
        window.navigator.msSaveOrOpenBlob(blob, 'download.ics');

    }
    Count = Count + 1;

}

it is not working for me. Help someone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants