<commit_before>/**
 * Created by rg12 on 02/05/2016.
 */

/**
 * @desc sales directive that can be used anywhere across the sales app at a company named Acme
 * @example <cp-widget-punt-status></cp-widget-punt-status>
 */

(function () {
  'use strict';

  angular
    .module('app.widgets')
    .directive('cpWidgetPuntStatus', cpWidgetPuntStatus)
    .filter('statusCircle', statusCircle)
    .filter('bookingSimple', bookingSimple)
    .filter('bookingTooltip', bookingTooltip);

  /* @ngInject */
  function cpWidgetPuntStatus() {
    //Usage:
    //<div cp-widget-punt-status></div>
    // Creates:
    // punt status table
    var directive = {
      scope: {
        'punts': '=',
        'bookings': '='
      },
      templateUrl: 'app/widgets/widget-punt-status.html',
      restrict: 'EA',
      controller: PuntStatus,
      controllerAs: 'vm',
      bindToController: true
    };
    return directive;

    function PuntStatus() {
      var vm = this;

      activate();

      function activate() {
        if (vm.punts !== undefined) {
          getStatus();
        }
      }

      function getStatus() {
        var now = new Date();
        var midnight = new Date(now);
        midnight.setUTCHours(31, 0, 0, 0); // 7am
        var currentBookings = vm.bookings.filter(function (booking) {
          return new Date(booking.timeFrom) <= now && new Date(booking.timeTo) >= now;
        });
        var nextBookings = vm.bookings.filter(function (booking) {
          return new Date(booking.timeFrom) >= now && new Date(booking.timeTo) <= midnight;<commit_msg>Fix timezone offset on punt status<commit_after>/**
 * Created by rg12 on 02/05/2016.
 */

/**
 * @desc sales directive that can be used anywhere across the sales app at a company named Acme
 * @example <cp-widget-punt-status></cp-widget-punt-status>
 */

(function () {
  'use strict';

  angular
    .module('app.widgets')
    .directive('cpWidgetPuntStatus', cpWidgetPuntStatus)
    .filter('statusCircle', statusCircle)
    .filter('bookingSimple', bookingSimple)
    .filter('bookingTooltip', bookingTooltip);

  /* @ngInject */
  function cpWidgetPuntStatus() {
    //Usage:
    //<div cp-widget-punt-status></div>
    // Creates:
    // punt status table
    var directive = {
      scope: {
        'punts': '=',
        'bookings': '='
      },
      templateUrl: 'app/widgets/widget-punt-status.html',
      restrict: 'EA',
      controller: PuntStatus,
      controllerAs: 'vm',
      bindToController: true
    };
    return directive;

    function PuntStatus() {
      var vm = this;

      activate();

      function activate() {
        if (vm.punts !== undefined) {
          getStatus();
        }
      }

      function getStatus() {
        var dt = new Date();
        var now = new Date(dt.getTime() - (60000 * dt.getTimezoneOffset()));
        var midnight = new Date(now);
        midnight.setUTCHours(31, 0, 0, 0); // 7am
        var currentBookings = vm.bookings.filter(function (booking) {
          return new Date(booking.timeFrom) <= now && new Date(booking.timeTo) >= now;
        });
        var nextBookings = vm.bookings.filter(function (booking) {
          return new Date(booking.timeFrom) >= now && new Date(booking.timeTo) <= midnight;
{'fraction_non_alphanumeric': 0.14193548387096774, 'fraction_numerical': 0.011367127496159755, 'mean_word_length': 2.4345991561181433, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3010411', 'n_tokens_mistral': 1041, 'n_tokens_neox': 998, 'n_words': 238}