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).
The code is as follows:
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'))
I get the data m.hour ()
, m.minute ()
, etc but there is a way to get the am / pm format, I have not found anything about it, something perhaps as m.meridian () => "am "or" pm "
.
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.