moment-range icon indicating copy to clipboard operation
moment-range copied to clipboard

IE8 problems

Open indvd00m opened this issue 6 years ago • 4 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.

indvd00m avatar Mar 29 '18 12:03 indvd00m

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

gf3 avatar Mar 29 '18 16:03 gf3

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

indvd00m avatar Mar 30 '18 09:03 indvd00m

@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>

TristanJM avatar Apr 06 '18 10:04 TristanJM

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: https://github.com/martinandert/counterpart/issues/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.

indvd00m avatar Apr 06 '18 11:04 indvd00m