<commit_before>const color = require('./app/components/tasks/color');
/**
 * Used for changing list item texts after
 * tasks are loaded from database.
 *
 * Cast on task list items.
 */
angular.module('MainApp')
  .directive('uaf', $compile =>  // uaf = Update after find
    (scope, el, attrs) => {
      scope.$watch('openTasks', (newVal) => {
        const icon = $compile('<md-icon md-svg-src="assets/img/cube.svg" class="small md-primary"></md-icon>')(scope);
        const isOneday = (newVal[attrs.uaf].end - newVal[attrs.uaf].start) === 86400000;
        const isPeriodic = newVal[attrs.uaf].period !== -1;
        let oneday;
        if (isOneday) {
          oneday = $compile('<md-icon md-svg-src="assets/img/one.svg" class="medium md-accent"></md-icon>')(scope);
        }
        let period;
        if (isPeriodic) {
          period = newVal[attrs.uaf].period / 86400000;
          period = $compile(`<h6 class="inline grey">${period}day${period === 1 ? '' : 's'}</h6><md-icon md-svg-src="assets/img/repeat.svg" class="small"></md-icon>`)(scope);
        }
        el[0].children[0].children[0].innerHTML = `<p class="inline">${newVal[attrs.uaf].text}</p>&nbsp;&nbsp;<h6 class="inline mp">${newVal[attrs.uaf].units}</h6>`;
        angular.element(el[0].children[0].children[0]).append(icon);
        angular.element(el[0].children[0].children[0]).append(oneday);
        angular.element(el[0].children[0].children[0]).append(period);
        const borderLeft = `5px solid ${color.returnColor(newVal[attrs.uaf].start, newVal[attrs.uaf].end, Date.now())}`;
        angular.element(el[0]).css('borderLeft', borderLeft);
      });
    }
  )
  .directive('uafo', $compile =>  // uafo = Update after find, overdue
    (scope, el, attrs) => {
      scope.$watch('overdueTasks', (newVal) => {
        const icon = $compile('<md-icon md-svg-src="assets/img/cube.svg" class="small md-warn"></md-icon>')(scope);
        const isOneday = (newVal[attrs.uafo].end - newVal[attrs.uafo].start) === 86400000;
        const isPeriodic = newVal[attrs.uafo].period !== -1;
        let oneday;
        if (isOneday) {
          oneday = $compile('<md-icon md-svg-src="assets/img/one.svg" class="medium md-accent"></md-icon>')(scope);
        }
        let period;
        if (isPeriodic) {
          period = newVal[attrs.uafo].period / 86400000;
          period = $compile(`<h6 class="inline grey">${period}day${period === 1 ? '' : 's'}</h6><md-icon md-svg-src="assets/img/repeat.svg" class="small"></md-icon>`)(scope);
        }
        el[0].children[0].children[0].innerHTML = `<p class="inline">${newVal[attrs.uafo].text}</p>&nbsp;<h6 class="inline mw">${newVal[attrs.uafo].units}</h6>`;
        angular.element(el[0].children[0].children[0]).append(icon);
        angular.element(el[0].children[0].children[0]).append(oneday);
        angular.element(el[0].children[0].children[0]).append(period);
        const borderLeft = `5px solid ${color.returnColorO(newVal[attrs.uafo].start, newVal[attrs.uafo].end, Date.now())}`;
        angular.element(el[0]).css('borderLeft', borderLeft);
      });
    }
  );
<commit_msg>Add due tomorrow and due today warnings<commit_after>const color = require('./app/components/tasks/color');
/**
 * Used for changing list item texts after
 * tasks are loaded from database.
 *
 * Cast on task list items.
 */
angular.module('MainApp')
  .directive('uaf', $compile =>  // uaf = Update after find
    (scope, el, attrs) => {
      scope.$watch('openTasks', (newVal) => {
        const icon = $compile('<md-icon md-svg-src="assets/img/cube.svg" class="small md-primary"></md-icon>')(scope);
        const isOneday = (newVal[attrs.uaf].end - newVal[attrs.uaf].start) === 86400000;
        const isPeriodic = newVal[attrs.uaf].period !== -1;
        const now = Date.now();
        const isDueToday = (newVal[attrs.uaf].end - now) < 86400000;
        const isDueTomorrow = (newVal[attrs.uaf].end - now) < 86400000 * 2;
        let oneday;
        if (isOneday) {
          oneday = $compile('<md-icon md-svg-src="assets/img/one.svg" class="medium md-accent"></md-icon>')(scope);
        }
        let period;
        if (isPeriodic) {
          period = newVal[attrs.uaf].period / 86400000;
          period = $compile(`<h6 class="inline grey">${period}day${period === 1 ? '' : 's'}</h6><md-icon md-svg-src="assets/img/repeat.svg" class="small"></md-icon>`)(scope);
        }
        let dueToday = '';
        let dueTomorrow = '';
        if (isDueToday) {
          dueToday = '<p class="inline">Due Today</p>';
        } else if (isDueTomorrow) {
          dueTomorrow = '<p class="inline">Due Tomorrow</p>';
        }
        el[0].children[0].children[0].innerHTML = `<p class="inline">${newVal[attrs.uaf].text}</p>&nbsp;&nbsp;<h6 class="inline mp">${newVal[attrs.uaf].units}</h6>`;
        angular.element(el[0].children[0].children[0]).append(icon);
        angular.element(el[0].children[0].children[0]).append(oneday);
        angular.element(el[0].children[0].children[0]).append(period);
        angular.element(el[0].children[0].children[0]).append(dueToday);
        angular.element(el[0].children[0].children[0]).append(dueTomorrow);
        const borderLeft = `5px solid ${color.returnColor(newVal[attrs.uaf].start, newVal[attrs.uaf].end, Date.now())}`;
        angular.element(el[0]).css('borderLeft', borderLeft);
      });
    }
  )
  .directive('uafo', $compile =>  // uafo = Update after find, overdue
    (scope, el, attrs) => {
      scope.$watch('overdueTasks', (newVal) => {
        const icon = $compile('<md-icon md-svg-src="assets/img/cube.svg" class="small md-warn"></md-icon>')(scope);
        const isOneday = (newVal[attrs.uafo].end - newVal[attrs.uafo].start) === 86400000;
        const isPeriodic = newVal[attrs.uafo].period !== -1;
        let oneday;
        if (isOneday) {
          oneday = $compile('<md-icon md-svg-src="assets/img/one.svg" class="medium md-accent"></md-icon>')(scope);
        }
        let period;
        if (isPeriodic) {
          period = newVal[attrs.uafo].period / 86400000;
          period = $compile(`<h6 class="inline grey">${period}day${period === 1 ? '' : 's'}</h6><md-icon md-svg-src="assets/img/repeat.svg" class="small"></md-icon>`)(scope);
        }
        el[0].children[0].children[0].innerHTML = `<p class="inline">${newVal[attrs.uafo].text}</p>&nbsp;<h6 class="inline mw">${newVal[attrs.uafo].units}</h6>`;
        angular.element(el[0].children[0].children[0]).append(icon);
        angular.element(el[0].children[0].children[0]).append(oneday);
        angular.element(el[0].children[0].children[0]).append(period);
        const borderLeft = `5px solid ${color.returnColorO(newVal[attrs.uafo].start, newVal[attrs.uafo].end, Date.now())}`;
        angular.element(el[0]).css('borderLeft', borderLeft);
      });
    }
  );

{'fraction_non_alphanumeric': 0.20424286759326993, 'fraction_numerical': 0.02443306510607169, 'mean_word_length': 3.181039755351682, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 67, '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': '1203118', 'n_tokens_mistral': 2397, 'n_tokens_neox': 2309, 'n_words': 351}