<commit_before>(function() {
    'use strict;'

    angular.module('app').directive('simpleCalendar', ['$timeout', '$interval', '$window', function($timeout, $interval, $window) {
        return {
            restrict: 'E',
            templateUrl: 'directives/simpleCalendar/simpleCalendar.html',
            replace: true,
            scope: {
                calendars: '=',
                showTitles: '='
            },
            link: function (scope, element, attr) {
                var pxPerHour = parseInt(attr.pxPerHour || 75);
                var minHeight = parseInt(attr.minHeight || 24);
                var vMargin = parseInt(attr.vMargin || 2);
                var hours = parseInt(attr.hours || 72);
                scope.vHeight = pxPerHour * hours;
                
                scope.styles = function styles(evt) {
                    var top = scope.getOffset(evt.Start);
                    var bottom = scope.getOffset(evt.End);
                    return {
                        top: top,
                        height: Math.max(bottom - top - vMargin, minHeight)
                    };
                };
                scope.formatHour = function formatHour(value) {
                    return moment(value).format('h a');
                };
                scope.formatTime = function formatTime(value) {
                    return moment(value).format('h:mm a');
                };
                scope.status = function status(calendar) {
                    var current = calendar.CurrentMeeting;
                    if (!current) {
                        return 'Free';
                    }
                    if(!current.IsStarted && moment(current.Start).isAfter(scope.now))
                    {
                        return 'Free until ' + scope.formatTime(current.Start);
                    }
                    var until = current.End;
                    calendar.NearTermMeetings.forEach(function (a) {
                        if (a.Start == until) {
                            until = a.End;
                        }
                    });
                    return 'Busy until ' + scope.formatTime(until);
                };
                scope.freeBusy = function freeBusy(calendar) {
                    var current = calendar.CurrentMeeting;
                    if (!current) {
                        return 'free';
                    }
                    if(!current.IsStarted && moment(current.Start).isAfter(scope.now))
                    {
                        return 'free';
                    }
                    return 'busy';
                };

                function update() {<commit_msg>Better handle being idle until the next day, or meetings that cover the rest of the day<commit_after>(function() {
    'use strict;'

    angular.module('app').directive('simpleCalendar', ['$timeout', '$interval', '$window', function($timeout, $interval, $window) {
        return {
            restrict: 'E',
            templateUrl: 'directives/simpleCalendar/simpleCalendar.html',
            replace: true,
            scope: {
                calendars: '=',
                showTitles: '='
            },
            link: function (scope, element, attr) {
                var pxPerHour = parseInt(attr.pxPerHour || 75);
                var minHeight = parseInt(attr.minHeight || 24);
                var vMargin = parseInt(attr.vMargin || 2);
                var hours = parseInt(attr.hours || 72);
                scope.vHeight = pxPerHour * hours;
                
                scope.styles = function styles(evt) {
                    var top = scope.getOffset(evt.Start);
                    var bottom = scope.getOffset(evt.End);
                    return {
                        top: top,
                        height: Math.max(bottom - top - vMargin, minHeight)
                    };
                };
                scope.formatHour = function formatHour(value) {
                    return moment(value).format('h a');
                };
                scope.formatTime = function formatTime(value) {
                    return moment(value).format('h:mm a');
                };
                scope.status = function status(calendar) {
                    var current = calendar.CurrentMeeting;
                    if (!current) {
                        return 'Free';
                    }
                    if(!current.IsStarted && moment(current.Start).isAfter(scope.now))
                    {
                        if(moment(scope.now).startOf('day').add(1, 'days').isBefore(moment(current.Start))) {
                            // nothing else today
                            return 'Free';
                        }
                        return 'Free until ' + scope.formatTime(current.Start);
                    }
                    var until = current.End;
                    calendar.NearTermMeetings.forEach(function (a) {
                        if (a.Start == until) {
                            until = a.End;
                        }
                    });
                    if(moment(scope.now).startOf('day').add(1, 'days').isBefore(moment(until))) {
                        // nothing else today
                        return 'Busy';
                    }
                    return 'Busy until ' + scope.formatTime(until);
                };
                scope.freeBusy = function freeBusy(calendar) {
                    var current = calendar.CurrentMeeting;
                    if (!current) {
                        return 'free';
                    }
                    if(!current.IsStarted && moment(current.Start).isAfter(scope.now))
                    {
                        return 'free';
                    }
                    return 'busy';
                };

                function update() {
{'fraction_non_alphanumeric': 0.10531697341513292, 'fraction_numerical': 0.0027266530334014998, 'mean_word_length': 1.0650950035186488, 'pattern_counts': {'":': 0, '<': 3, '<?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': '537468', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1316, 'n_words': 272}