I receive a json query object to an api, but the format I get is the following
2018-07-03T05:47:00.000Z
although I need to simply show this
2018-07-03
I receive a json query object to an api, but the format I get is the following
2018-07-03T05:47:00.000Z
although I need to simply show this
2018-07-03
If, like me, they have a similar case, the simplest solution is to register a filter with a split in our main.js file, which in this case would be like this
Vue.filter('formatDate', function(value) {
if (value) {
return value.split("T")[0];
}
});
When rendering, we simply use our brand-new filter
{{value.date | formatDate }}
I hope you find it useful if you need it.