March 2018
Intermediate to advanced
592 pages
13h 44m
English
Now for Send Location, we currently don't use Moment; we only updated the newMessage event listener. This means that when we print that location message, we don't have the timestamp. We're going to modify newLocationMessage, you can go ahead and use the same techniques we used previously to get the job done. Now in terms of where to actually render the formatted time, you can simply put it in li.text just like we did earlier in case of newMessage property.
Step one in the process is going to be to make that variable called formattedTime. We can actually go ahead and copy the following line:
var formattedTime = moment(message.createdAt).format('h:mm a');
And pasting it right above the var li = ...