[Vuejs]-Is there a way in Vue to convert military time into standard time

1👍

You can transform item values in a retrieved list further

mounted: function(){
    var currentDate = moment().format('YYYY-MM-DD');
    axios.get("https://mysiteurl.com/api/ordersseller=5e1f43c0c69e7&items.arrival="+currentDate)
     .then(response => {
      this.post = response.data.data.map(pr => ({
      ...pr,
      arrivalTime: moment(pr.arrivalTime, "HHmm").format("hh:mm A")
      })
}
);
},

data(){
    return{
      post: []
   }
}

0👍

Maybe something like this

let time = militaryTime/100-12 + ":00";

?

Leave a comment