title: BootstrapVue table : sort by date and by string?
body: <p>I am quite new to VueJS, and currently using BootstrapVue (latest version, v2.0.0), mostly its b-table feature. I load table items dynamically (from a JSON file), and one of my field (column) is a string, the other is a formatted date (dd/MM/YYYY). I would like be able to sort those dates like other string or number fields.
  The doc mention the possibility <a href="https://bootstrap-vue.js.org/docs/components/table/#sort-compare-routine" rel="nofollow noreferrer">to create custom sorting function</a>, so I wrote one (as a global function, using moment.js as suggested) :</p>
  
  <pre><code>function sortDate(a, b, key) {
    aDate = moment(a[key], 'DD/MM/YYYY')
    bDate = moment(b[key], 'DD/MM/YYYY')
    if (aDate.isValid &amp;&amp; bDate.isValid) {
      if (aDate &lt; bDate) {
        return -1
      }
      else if (aDate &gt; bDate) {
        return 1
      }
      else {
        return 0
      }
    }
    return null
  }
  </code></pre>
  
  <p>I then integrate it to HTML b-table using the :sort-compare tag : </p>
  
  <pre><code>&lt;b-table id="bh_table" :items="items" :fields="fields" :sort-compare="sortDate"&gt;&lt;/b-table&gt;
  </code></pre>
  
  <p>The problem is that the regulat string-sorting is broken, and I am not sure how to fix it ? Should I create a global method that should detect column type, and sort accordingly ?</p>
  
  <p>It seems to be the thing to do here, but I think it is quite counter-intuitive, getting possible duplicates (I have other table that contains number and dates, only dates, etc.)</p>