<commit_before>//
//  TaskTouchVC.swift
//  BetterReminders
//
//  Created by <NAME> on 3/28/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

class TaskVC: UITableViewController, AddTaskDelegate, UIPopoverPresentationControllerDelegate {
    
    var classes: [JHSchoolClass]!
    var clas: JHSchoolClass!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        title = clas.name
        
        setUp()
        
    }

    override func numberOfSections(in tableView: UITableView) -> Int {
        // #warning Incomplete implementation, return the number of sections
        return 1
    }

    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of rows
        return clas.tasks.count
    }
    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = UITableViewCell(style: .subtitle, reuseIdentifier: "taskCell")
        cell.textLabel?.text = clas.tasks[indexPath.row].name
        cell.detailTextLabel?.text = "\(clas.tasks[indexPath.row].dueDate!)"
        return cell
    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        tableView.deselectRow(at: indexPath, animated: true)
    }
    
    func didAddTask() {
        //Task was added
        saveClasses()
        tableView.reloadData()
    }
    
    func saveClasses() {<commit_msg>Displays due date of tasks in "weekDay, Month Day, year" format rather than a unix timestamp<commit_after>//
//  TaskTouchVC.swift
//  BetterReminders
//
//  Created by <NAME> on 3/28/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

class TaskVC: UITableViewController, AddTaskDelegate, UIPopoverPresentationControllerDelegate {
    
    var classes: [JHSchoolClass]!
    var clas: JHSchoolClass!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        title = clas.name
        
        setUp()
        
    }

    override func numberOfSections(in tableView: UITableView) -> Int {
        // #warning Incomplete implementation, return the number of sections
        return 1
    }

    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of rows
        return clas.tasks.count
    }
    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = UITableViewCell(style: .subtitle, reuseIdentifier: "taskCell")
        cell.textLabel?.text = clas.tasks[indexPath.row].name
        let outputFormatter = DateFormatter()
        outputFormatter.dateStyle = .full
        cell.detailTextLabel?.text = outputFormatter.string(from: clas.tasks[indexPath.row].dueDate!)
        return cell
    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        tableView.deselectRow(at: indexPath, animated: true)
    }
    
    func didAddTask() {
        //Task was added
        saveClasses()
        tableView.reloadData()
    }
    
    func saveClasses() {
{'fraction_non_alphanumeric': 0.09149722735674677, 'fraction_numerical': 0.0061614294516327784, 'mean_word_length': 2.648314606741573, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '4597721', 'n_tokens_mistral': 960, 'n_tokens_neox': 909, 'n_words': 245}