<commit_before>angular.module('app.utils.directives').directive('date', dateDirective);

function dateDirective() {
    return {
        restrict: 'E',
        scope: {
            date: '=',
            showTime: '=',
        },
        templateUrl: 'utils/directives/date.html',
        controller: DateController,
        controllerAs: 'vm',
        bindToController: true,
    };
}

DateController.$inject = [];
function DateController() {
    var vm = this;

    if (vm.date) {
        var date = moment(vm.date);

        if (date.isSame(moment(), 'day') && vm.showTime) {
            // In certain cases we want to display the time if it's the same day.
            vm.dateFormat = 'HH:mm';
        } else {
            if (window.innerWidth < 992) {
                // Display as a short version if it's a small screen (tablet, smartphone, etc.)
                vm.dateFormat = ' dd MMM. yyyy'; // Renders as 29 Dec. 2015
            } else {
                vm.dateFormat = ' dd MMMM yyyy'; // Renders as 29 December 2015
            }
        }
    }
}<commit_msg>LILY-1336: Made month in date notation display as MMM. instead of MMMM for better display in tables and such.<commit_after>angular.module('app.utils.directives').directive('date', dateDirective);

function dateDirective() {
    return {
        restrict: 'E',
        scope: {
            date: '=',
            showTime: '=',
        },
        templateUrl: 'utils/directives/date.html',
        controller: DateController,
        controllerAs: 'vm',
        bindToController: true,
    };
}

DateController.$inject = [];
function DateController() {
    var vm = this;

    if (vm.date) {
        var date = moment(vm.date);

        if (date.isSame(moment(), 'day') && vm.showTime) {
            // In certain cases we want to display the time if it's the same day.
            vm.dateFormat = 'HH:mm';
        } else {
            vm.dateFormat = 'dd MMM. yyyy'; // Renders as 29 Dec. 2015
        }
    }
}
{'fraction_non_alphanumeric': 0.12947103274559194, 'fraction_numerical': 0.012594458438287154, 'mean_word_length': 1.8824383164005805, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2872240', 'n_tokens_mistral': 616, 'n_tokens_neox': 580, 'n_words': 162}