Javascript comparison not working in Microsoft Edge

I created a calendar with JavaScript only; I need to compare dates of events stored in <<Element.dataset.date>>

with dates retrieved from a database, it works fine with Chrome and Firefox but not Edge.

var td = document.querySelector('td');
var date = new Date('2017-06-22');
td.dataset.date = date.toLocaleDateString();
console.log(td.dataset.date === '22/06/2017');

// Output true with Firefox and Chrome but false with Edge
      

<table>
  <tr>
    <td>1</td>
    <td>2</td>
    <td>3</td>
    <td>4</td>
    <td>5</td>
    <td>6</td>
    <td>7</td>
  </tr>
  ...
</table>
      

Run codeHide result


+3


source to share





All Articles