<commit_before>'use strict';

angular
  .module('mwl.calendar')
  .directive('mwlCalendar', function() {

    return {
      templateUrl: 'src/templates/calendar.html',
      restrict: 'EA',
      scope: {
        events: '=',
        view: '=',
        currentDay: '=',
        eventClick: '&',
        eventEditClick: '&',
        eventDeleteClick: '&',
        editEventHtml: '=',
        deleteEventHtml: '=',
        autoOpen: '=',
        useIsoWeek: '=',
        eventLabel: '@',
        timeLabel: '@',
        dayViewStart: '@',
        dayViewEnd: '@',
        weekTitleLabel: '@',
        timespanClick: '&',
        dayViewSplit: '@',
        viewTitle: '='
      },
      controller: function($scope, $timeout, moment, calendarTitle, calendarDebounce) {

        this.changeView = function(view, newDay) {
          $scope.view = view;
          $scope.currentDay = newDay;
        };

        //Use a debounce to prevent it being called 3 times on initialisation
        var refreshCalendar = calendarDebounce(function() {
          if (calendarTitle[$scope.view]) {
            $scope.viewTitle = calendarTitle[$scope.view]($scope.currentDay);
          }
          $scope.$broadcast('calendar.refreshView');
        }, 50);

        //Auto update the calendar when the locale changes
        var unbindLocaleWatcher = $scope.$watch(function() {
          return moment.locale();
        }, function(locale) {

          //Maintain backwards compatibility with the previous functionality of the calendar
          if ($scope.useIsoWeek === true) {
            moment.locale(locale, {
              week: {
                dow: 1 //set monday as the first day of the week
              }
            });
          }

          refreshCalendar();
        });

        var unbindOnDestroy = [];
        unbindOnDestroy.push(unbindLocaleWatcher);

        //Refresh the calendar when any of these variables change.
        unbindOnDestroy.push($scope.$watch('currentDay', refreshCalendar));
        unbindOnDestroy.push($scope.$watch('view', refreshCalendar));
        unbindOnDestroy.push($scope.$watch('events', refreshCalendar, true));

        //Remove any watchers when the calendar is destroyed
        var unbindDestroyListener = $scope.$on('$destroy', function() {
          unbindOnDestroy.forEach(function(unbind) {<commit_msg>As there are so many breaking changes just remove the deprecated attribute all together<commit_after>'use strict';

angular
  .module('mwl.calendar')
  .directive('mwlCalendar', function() {

    return {
      templateUrl: 'src/templates/calendar.html',
      restrict: 'EA',
      scope: {
        events: '=',
        view: '=',
        currentDay: '=',
        eventClick: '&',
        eventEditClick: '&',
        eventDeleteClick: '&',
        editEventHtml: '=',
        deleteEventHtml: '=',
        autoOpen: '=',
        eventLabel: '@',
        timeLabel: '@',
        dayViewStart: '@',
        dayViewEnd: '@',
        weekTitleLabel: '@',
        timespanClick: '&',
        dayViewSplit: '@',
        viewTitle: '='
      },
      controller: function($scope, $timeout, moment, calendarTitle, calendarDebounce) {

        this.changeView = function(view, newDay) {
          $scope.view = view;
          $scope.currentDay = newDay;
        };

        //Use a debounce to prevent it being called 3 times on initialisation
        var refreshCalendar = calendarDebounce(function() {
          if (calendarTitle[$scope.view]) {
            $scope.viewTitle = calendarTitle[$scope.view]($scope.currentDay);
          }
          $scope.$broadcast('calendar.refreshView');
        }, 50);

        //Auto update the calendar when the locale changes
        var unbindLocaleWatcher = $scope.$watch(function() {
          return moment.locale();
        }, refreshCalendar);

        var unbindOnDestroy = [];
        unbindOnDestroy.push(unbindLocaleWatcher);

        //Refresh the calendar when any of these variables change.
        unbindOnDestroy.push($scope.$watch('currentDay', refreshCalendar));
        unbindOnDestroy.push($scope.$watch('view', refreshCalendar));
        unbindOnDestroy.push($scope.$watch('events', refreshCalendar, true));

        //Remove any watchers when the calendar is destroyed
        var unbindDestroyListener = $scope.$on('$destroy', function() {
          unbindOnDestroy.forEach(function(unbind) {
{'fraction_non_alphanumeric': 0.13145326358881054, 'fraction_numerical': 0.0015919945417329998, 'mean_word_length': 2.2919161676646707, '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': '900648', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1164, 'n_words': 259}