Is documentation available for the 'format' method of the 'moment' object?

  • 1
  • Question
  • Updated 4 years ago
  • Answered
  • (Edited)
Where can I find documentation for the `format` method that's used in the new calendar widget code? I'm trying to customize that widget to display weekday names.

In widget-google-calendar-master/src/settings.html there are some lines like this:

    <option value="D/M/YYYY">{{currentDate | date: "dd'/'MM'/'yyyy"}}</option>


 The stuff in double quotes after date: is obviously a angular.js date format string. But the system seems (if I understand the code correctly) to use the stuff in value="" to render the date. What can I put there? 

Any pointers would be helpful.
Photo of Oliver Jones

Oliver Jones

  • 692 Points 500 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Donna Peplinskie

Donna Peplinskie

  • 7,142 Points 5k badge 2x thumb
Hi Oliver,

moment.js is a third party library that we're using. You can find documentation about the format method here - http://momentjs.com/docs/#/displaying/. If you're interested in showing weekdays, you'll likely want to use a format string that includes 'dddd' for the full day or just 'ddd' for abbreviated versions.

Thx.
Photo of Oliver Jones

Oliver Jones

  • 692 Points 500 badge 2x thumb
Thanks Donna!