This site describes our support for the AngularJS (1.x) framework. Visit developer.blackbaud.com/skyux for information on our latest version.

Moment

The moment module allows you to use the Moment.js library to handle dates in JavaScript. SKY UX locale files automatically include their matching moment locale definitions. When including a SKY UX locale file, the moment locale is also globally set.

Demo

Today's moment date is {{momentCtrl.momentDate}}.

Markup

<div ng-controller="MomentTestController as momentCtrl">
    <div>
        Today's moment date is {{momentCtrl.momentDate}}.
    </div>
</div>

JavaScript

/*global angular */

(function () {
    'use strict';

    function MomentTestController(bbMoment) {
        var self = this;

        self.momentDate = bbMoment().format('MMMM D, YYYY, h:mm:ss a');
    }

    MomentTestController.$inject = ['bbMoment'];

    angular.module('stache').controller('MomentTestController', MomentTestController);

}());