<commit_before>//
//  DayCalculatorViewController.swift
//  PunctualExample
//
//  Created by <NAME> on 4/11/15.
//  Copyright (c) 2015 harlanhaskins. All rights reserved.
//

import UIKit

class DayCalculatorViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.updateDate()

        // Do any additional setup after loading the view.
    }
    
    func updateDate() {
        if let
            hours = self.hours,
            days = self.days,
            months = self.months,
            years = self.years,
            newDate = (hours + days + months + years).ago {
            self.dateLabel.text = newDate.mediumString
        } else {
            self.dateLabel.text = "Invalid Date"
        }
    }
    
    @IBAction func fieldDidChange(sender: UITextField) {
        self.updateDate()
    }

    @IBOutlet weak var dateLabel: UILabel!
    
    @IBOutlet weak var hoursTextField: UITextField!
    var hours: NSDateComponents? {
        return self.hoursTextField.text.toInt()?.hours
    }
    @IBOutlet weak var daysTextField: UITextField!
    var days: NSDateComponents? {
        return self.daysTextField.text.toInt()?.days
    }
    @IBOutlet weak var monthsTextField: UITextField!
    var months: NSDateComponents? {
        return self.monthsTextField.text.toInt()?.days
    }
    @IBOutlet weak var yearsTextField: UITextField!
    var years: NSDateComponents? {
        return self.yearsTextField.text.toInt()?.years
    }
}<commit_msg>Fixed reported time in months -- whoops!<commit_after>//
//  DayCalculatorViewController.swift
//  PunctualExample
//
//  Created by <NAME> on 4/11/15.
//  Copyright (c) 2015 harlanhaskins. All rights reserved.
//

import UIKit

class DayCalculatorViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.updateDate()

        // Do any additional setup after loading the view.
    }
    
    func updateDate() {
        if let
            hours = self.hours,
            days = self.days,
            months = self.months,
            years = self.years,
            newDate = (hours + days + months + years).ago {
            self.dateLabel.text = newDate.mediumString
        } else {
            self.dateLabel.text = "Invalid Date"
        }
    }
    
    @IBAction func fieldDidChange(sender: UITextField) {
        self.updateDate()
    }

    @IBOutlet weak var dateLabel: UILabel!
    
    @IBOutlet weak var hoursTextField: UITextField!
    var hours: NSDateComponents? {
        return self.hoursTextField.text.toInt()?.hours
    }
    @IBOutlet weak var daysTextField: UITextField!
    var days: NSDateComponents? {
        return self.daysTextField.text.toInt()?.days
    }
    @IBOutlet weak var monthsTextField: UITextField!
    var months: NSDateComponents? {
        return self.monthsTextField.text.toInt()?.months
    }
    @IBOutlet weak var yearsTextField: UITextField!
    var years: NSDateComponents? {
        return self.yearsTextField.text.toInt()?.years
    }
}
{'fraction_non_alphanumeric': 0.0971540726202159, 'fraction_numerical': 0.005888125613346418, 'mean_word_length': 2.2497343251859725, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1372424', 'n_tokens_mistral': 944, 'n_tokens_neox': 887, 'n_words': 217}