eight04 / angular-datetime

A directive to add the behavior of datetime input on unsupported browsers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IE 11 not supported

raaaste opened this issue · comments

I have the element <input class="ng-pristine ng-valid ng-touched" type="text" ng-model="arvio.paivamaara" ng-disabled="operationInProgress" datetime="dd.MM.yyyy">, with the model being a date.
IE 11 displays Fri Jul 06 2018 12:11:02 GMT+0300 (Suomen kesäaika), while Firefox and Chrome both format it as specified in the datetime attribute: 06.07.2018.

I checked the console and it says something like "TypeError: Object does not support property or function values".

commented

I can run the demo on IE11 without problems. Could you provide a demo that generates the error? You can put it on plunker.

https://plnkr.co/edit/KkN6vK770qe8ij2eiG9Q This works in Chrome and Firefox, but for some reason IE won't even load the page, probably due to plunker. But I managed to reproduce the error on IE 11 by downloading the plunk and running it locally. The date string isn't the same as above (it really doesn't do anything on IE) but the error message is the same

IE version: 11.0.9600.19080

Here's the stack from the console (See translation for the error message above):

TypeError: Objekti ei tue ominaisuutta tai menetelmää values at m (https://unpkg.com/angular-datetime-input:1:9343) at invoke (https://code.angularjs.org/1.4.12/angular.js:4570:7) at enforcedReturnValue (https://code.angularjs.org/1.4.12/angular.js:4422:7) at invoke (https://code.angularjs.org/1.4.12/angular.js:4570:7) at Anonymous function (https://code.angularjs.org/1.4.12/angular.js:4387:13) at getService (https://code.angularjs.org/1.4.12/angular.js:4529:11) at invoke (https://code.angularjs.org/1.4.12/angular.js:4558:9) at Anonymous function (https://code.angularjs.org/1.4.12/angular.js:7369:17) at forEach (https://code.angularjs.org/1.4.12/angular.js:341:11) at Anonymous function (https://code.angularjs.org/1.4.12/angular.js:7367:13)

commented

IE doesn't support Object.values, so you have to include babel-polyfill.

Working demo:
https://run.plnkr.co/TLWyBlLuZ5bMNkHb/

I guess we should clarify the polyfill dependency in the readme.

Thanks, I'll try adding it. Demo link doesn't work, though.

EDIT: Just to confirm; adding babel-polyfill fixed the problem. Thanks!