title: Convert date format in Javascript using VueJS
body: <p>I have a date format of <code>19 Oct 2017</code> and want to convert it to this format <code>20171019</code></p>
  
  <p>Is there a quick way of doing this? I am using <code>FlatPickr</code> in VueJs. Please find my code below if its any help.</p>
  
  <pre class="lang-js prettyprint-override"><code>import flatPickr from 'vue-flatpickr-component';
  import 'flatpickr/dist/flatpickr.css';
  import Navigation from './Navigation'
  import bus from '../bus'
  export default {
    data() {
      return {
        showPanel: false,
        isClosed: false,
        arrival: null,
        departure: null,
        config: {
          dateFormat: "Ymd"
        }
      }
    },
    components: {
      flatPickr
    },
    methods: {
      closeMenu: function() {
        this.$store.state.showBooking = false;
      }
    },
    mounted() {
      bus.$on('show-booking', () =&gt; {
        this.showPanel = true;
      })
    }
  }
  </code></pre>