I'm trying to use http://momentjs.com/docs/#/manipulating/ to show the day (Monday), the month (July) and the number date (20) four days in the future. so basically I'm trying to do today+4 and to display day, month, #. i knew jquery was the best bet when i came upon moment.js
i put the
<script src="js/moment.js"></script>
<script>
moment().format();
</script>
in my footer like the instructions said and I'm using
<p class="day"><script>document.write(moment().add(4, 'day'));</script></p>
to try and display it. this part is just for the "Friday" part cause I'm still trying to figure out how to do the month and number date, but I'm thinking help with this part may really help with the other two.
Your help is greatly appreciated. Thank you.
var fourDaysForward = new moment().add(4, 'day');
document.write(fourDaysForward.format('dddd MMMM DD'));
Use the .format() with the appropriate arguments. See docs here
Thus, I think you're looking for moment.format('dddd MMMM D')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With