Skip to content

Commit 7c2db38

Browse files
committed
Looks like schedule is almost also finished
1 parent 6b60efd commit 7c2db38

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

Binary file not shown.

Hack FSU/HFFeedViewController.swift

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ class HFFeedViewController: UIViewController, UITableViewDelegate, UITableViewDa
147147
let name = results["name"].stringValue
148148
let description = results["description"].stringValue
149149
let startTime = results["start"].stringValue
150-
151-
let finalStartTime = theTIMEBIH(startTime,format: "E h:mm a");
150+
151+
let finalStartTime = theTIMEBIH(startTime, formatIn: "yyyy-MM-dd'T'HH:mm:ssZZZZZ", formatOut: "h:mm a");
152152

153153
let newScheduleItem = HFScheduleItem(title: name,
154154
subtitle: description,
@@ -157,9 +157,6 @@ class HFFeedViewController: UIViewController, UITableViewDelegate, UITableViewDa
157157
}
158158

159159
}
160-
for i in self.scheduleNames {
161-
print(i)
162-
}
163160
self.feedTableView.reloadData()
164161
}
165162

@@ -217,7 +214,7 @@ class HFFeedViewController: UIViewController, UITableViewDelegate, UITableViewDa
217214

218215
let hi = updatesDates[indexPath.section]
219216

220-
cell.timestamp.text = theTIMEBIH(hi,format: "E h:mm a");
217+
cell.timestamp.text = theTIMEBIH(hi, formatIn: "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", formatOut: "E h:mm a");
221218

222219
cell.configureFlatCellWithColor(tempCellColor, selectedColor: tempCellColor, roundingCorners: .AllCorners)
223220
cell.cornerRadius = 3.5
@@ -322,13 +319,13 @@ class HFFeedViewController: UIViewController, UITableViewDelegate, UITableViewDa
322319
}
323320
}
324321

325-
func theTIMEBIH(date: String, format: String) -> String {
322+
func theTIMEBIH(date: String, formatIn: String, formatOut: String) -> String {
326323

327324
let dateFormatterGet = NSDateFormatter()
328-
dateFormatterGet.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
325+
dateFormatterGet.dateFormat = formatIn
329326

330327
let dateFormatterPrint = NSDateFormatter()
331-
dateFormatterPrint.dateFormat = format
328+
dateFormatterPrint.dateFormat = formatOut
332329

333330
let date: NSDate? = dateFormatterGet.dateFromString(date)
334331

0 commit comments

Comments
 (0)