<commit_before>//
//  NSDate+Extensions.swift
//  Goalie
//
//  Created by <NAME> on 1/2/16.
//  Copyright © 2016 Incipia. All rights reserved.
//

import Foundation

struct DateFormatter
{
   static private var sharedInstance = DateFormatter()
   
   static var formatter: NSDateFormatter {
      return sharedInstance.formatter
   }
   
   private lazy var formatter: NSDateFormatter = {
      let df = NSDateFormatter()
      return df
   }()
}

extension NSDate
{
   var hour: Int {
   return NSCalendar.autoupdatingCurrentCalendar().components((.Hour), fromDate: self).hour
   }
   
   var minute: Int {
      return NSCalendar.autoupdatingCurrentCalendar().components((.Minute), fromDate: self).minute
   }
   
   var day: Int {
      return NSCalendar.autoupdatingCurrentCalendar().components((.Day), fromDate: self).day
   }
   
   var month: Int {
      return NSCalendar.autoupdatingCurrentCalendar().components((.Month), fromDate: self).month
   }
   
   func logHourAndMinute()
   {
      print("hour: \(self.hour) minute: \(self.minute)")
   }
   
   func prettyDateString() -> String
   {<commit_msg>Added method to date extension<commit_after>//
//  NSDate+Extensions.swift
//  Goalie
//
//  Created by <NAME> on 1/2/16.
//  Copyright © 2016 Incipia. All rights reserved.
//

import Foundation

struct DateFormatter
{
   static private var sharedInstance = DateFormatter()
   
   static var formatter: NSDateFormatter {
      return sharedInstance.formatter
   }
   
   private lazy var formatter: NSDateFormatter = {
      let df = NSDateFormatter()
      return df
   }()
}

extension NSDate
{
   var hour: Int {
   return NSCalendar.autoupdatingCurrentCalendar().components((.Hour), fromDate: self).hour
   }
   
   var minute: Int {
      return NSCalendar.autoupdatingCurrentCalendar().components((.Minute), fromDate: self).minute
   }
   
   var day: Int {
      return NSCalendar.autoupdatingCurrentCalendar().components((.Day), fromDate: self).day
   }
   
   var month: Int {
      return NSCalendar.autoupdatingCurrentCalendar().components((.Month), fromDate: self).month
   }
   
   func dateHalfwayBetweenDate(date: NSDate) -> NSDate
   {
      let difference = max(timeIntervalSince1970, date.timeIntervalSince1970) - min(timeIntervalSince1970, date.timeIntervalSince1970)
      let newTimeInterval = max(timeIntervalSince1970, date.timeIntervalSince1970) - (difference * 0.5)
      return NSDate(timeIntervalSince1970: newTimeInterval)
   }
   
   func logHourAndMinute()
   {
      print("hour: \(self.hour) minute: \(self.minute)")
   }
   
   func prettyDateString() -> String
   {
{'fraction_non_alphanumeric': 0.11021814006888633, 'fraction_numerical': 0.017604286261002678, 'mean_word_length': 3.1230283911671926, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '792106', 'n_tokens_mistral': 839, 'n_tokens_neox': 804, 'n_words': 181}