rotaready / moment-range

Fancy date ranges for Moment.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IE8 problems

indvd00m opened this issue · comments

File moment-range.js contains objects fields with name "default" and "for". This is broke working of moment-range in Internet Explorer 8 because of IE treat this fields as keywords.

hi! how are you including moment-range in your app? and are you using a build system?

No, there is no build system for client-side code in this project. File moment-range.js was downloaded from CDN and included as <script/> tag.

@indvd00m Are you including the files as follows?

<script src="CDN for moment.js"></script>
<script src="CDN for moment-range.js"></script>

<script>
    window['moment-range'].extendMoment(moment);
    // ...
</script>

Yes, all included in accordence with documentation. Just open the file from first comment in this issue, line 137:

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

This is same problem as here, for example: martinandert/counterpart#6

As a temporary solution I escaped "default" and "for" fields with quotes when them declared, and replace .field_name with ['field_name'] construction when them used. Or it is possible just rename this fields.