filter Date vuejs code example
Example 1: vue print date
import moment from 'moment'
Vue.filter('formatDate', function(value) {
if (value) {
return moment(String(value)).format('MM/DD/YYYY hh:mm')
}
}
Example 2: vuejs filter array by dates
<ul id="sortbydate">
<li v-for="(item, index) in items" style="list-style:none">
{{ index }} - {{ item.date }}
</li>
</ul>