Warning: We no longer develop features for this version of SKY UX, and we recommend that you use the latest version instead. This site describes the AngularJS (1.x) implementation of the SKY UX framework. We still support this version, but it is in maintenance mode. For more information, see developer.blackbaud.com/skyux.

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);

}());