title: How to get the meridian (am / pm) with momentsjs and angularjs
body: <p>I have a question about the library moments.js, I have an application in angularjs where I have six select elements for the year, month, day, hour, minutes, and am / pm format. I am using the following format moment to build m.format date ('YYYY-MM-DD hh: mm: ss a).</p>
  
  <p>The code is as follows:</p>
  
  <pre><code>var m = moment([scope.val.year, scope.val.month, scope.val.date, scope.val.hour, scope.val.minute]); //build date 
  
  model.$setViewValue(m.format('YYYY-MM-DD hh:mm:ss a'))
  </code></pre>
  
  <p>I get the data <code>m.hour ()</code>, <code>m.minute ()</code>, etc but there is a way to get the am / pm format, I have not found anything about it, something perhaps as <code>m.meridian () =&gt; "am "or" pm "</code>.</p>
  
  <p>I would build the array passing as parameter if am or pm, and then also would get from any date if am or pm date.</p>