From 7e8b51bb192e432d4b85117df34d218c4267445b Mon Sep 17 00:00:00 2001 From: Jason Salzman Date: Mon, 22 May 2017 04:53:49 -0700 Subject: [PATCH] =?UTF-8?q?obviously=20working=20too=20late.=20somehow=20o?= =?UTF-8?q?verwrote=20my=20own=20previous=20commit=E2=80=A6=20-=20adding?= =?UTF-8?q?=20back=20in=20the=20IE=20bug=20fix=20polyfill=20for=20`startsW?= =?UTF-8?q?ith`=20-=20also=20updating=20the=20README=20to=20reflect=20late?= =?UTF-8?q?st=20supported=20react=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore-backup | 9 --------- README.md | 2 +- package.json | 2 +- src/ReactAddToCalendar.js | 10 +++++++++- 4 files changed, 11 insertions(+), 12 deletions(-) delete mode 100644 .gitignore-backup diff --git a/.gitignore-backup b/.gitignore-backup deleted file mode 100644 index 49feedd..0000000 --- a/.gitignore-backup +++ /dev/null @@ -1,9 +0,0 @@ -node_modules -.sass-cache -npm-debug.log -.idea -dist -lib -tmp -coverage -0.md diff --git a/README.md b/README.md index 3ca2aae..7076d6b 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ See [here](https://github.com/jasonsalzman/react-add-to-calendar/blob/master/doc I'll do my best to stay compatible with the latest version of React. I can't guarantee support for all older versions of React. Latest compatible versions: -- React 15.0.0 or newer +- React 15.5.0 or newer ### Browser Support diff --git a/package.json b/package.json index 2f604d8..29e0c83 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Jason Salzman", "name": "react-add-to-calendar", "description": "A simple and reusable add to calendar button component for React", - "version": "0.1.0", + "version": "0.1.1", "license": "MIT", "homepage": "https://github.com/jasonsalzman/react-add-to-calendar", "repository": { diff --git a/src/ReactAddToCalendar.js b/src/ReactAddToCalendar.js index 012507c..529ff27 100644 --- a/src/ReactAddToCalendar.js +++ b/src/ReactAddToCalendar.js @@ -18,6 +18,14 @@ export default class ReactAddToCalendar extends React.Component { } componentWillMount() { + // polyfill for startsWith to fix IE bug + if (!String.prototype.startsWith) { + String.prototype.startsWith = function(searchString, position) { + position = position || 0; + return this.indexOf(searchString, position) === position; + }; + } + let isCrappyIE = false; if ( typeof window !== "undefined" && @@ -217,4 +225,4 @@ ReactAddToCalendar.defaultProps = { { yahoo: "Yahoo" } ], rootClass: "react-add-to-calendar" -}; +}; \ No newline at end of file