Interval, date format
This commit is contained in:
parent
c23853ebe7
commit
a16f2e124d
@ -19,6 +19,7 @@
|
||||
857EB22C1DF974F500CCA941 /* Ticket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 857EB22B1DF974F500CCA941 /* Ticket.swift */; };
|
||||
857EB22F1DF9845200CCA941 /* TicketExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 857EB22E1DF9845200CCA941 /* TicketExtension.swift */; };
|
||||
85DB9C401E03F73E0073EDE4 /* WindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85DB9C3F1E03F73E0073EDE4 /* WindowController.swift */; };
|
||||
85DB9C431E040A550073EDE4 /* Date.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85DB9C421E040A550073EDE4 /* Date.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@ -57,6 +58,7 @@
|
||||
857EB22B1DF974F500CCA941 /* Ticket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Ticket.swift; path = Model/Ticket.swift; sourceTree = "<group>"; };
|
||||
857EB22E1DF9845200CCA941 /* TicketExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TicketExtension.swift; path = Model/Extension/TicketExtension.swift; sourceTree = "<group>"; };
|
||||
85DB9C3F1E03F73E0073EDE4 /* WindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WindowController.swift; sourceTree = "<group>"; };
|
||||
85DB9C421E040A550073EDE4 /* Date.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Date.swift; path = Extension/Date.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -88,6 +90,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8505EACE1E01441F002A0BFB /* ViewControllerExtension.swift */,
|
||||
85DB9C421E040A550073EDE4 /* Date.swift */,
|
||||
);
|
||||
name = Extension;
|
||||
sourceTree = "<group>";
|
||||
@ -312,6 +315,7 @@
|
||||
857EB22C1DF974F500CCA941 /* Ticket.swift in Sources */,
|
||||
85DB9C401E03F73E0073EDE4 /* WindowController.swift in Sources */,
|
||||
854A87B01DF6BD9A00904B3E /* AppDelegate.swift in Sources */,
|
||||
85DB9C431E040A550073EDE4 /* Date.swift in Sources */,
|
||||
854A87DB1DF6C22C00904B3E /* Constants.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
||||
Binary file not shown.
@ -14,6 +14,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||
// Insert code here to initialize your application
|
||||
|
||||
var otrsTimer: Timer!
|
||||
otrsTimer = Timer.scheduledTimer(timeInterval: 60, target: self, selector: #selector(otrsTimerAction), userInfo: nil, repeats: true)
|
||||
|
||||
|
||||
// Here we just opt-in for allowing our instance of the NSTouchBar class to be customized throughout the app.
|
||||
if #available(OSX 10.12.2, *) {
|
||||
@ -42,5 +45,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
OTRS.sharedInstance.reload(que: que)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: Timer functions
|
||||
|
||||
func otrsTimerAction() {
|
||||
getTicketsFromOTRS()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -704,7 +704,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="738" height="479"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<tabView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Zi9-hf-1KA">
|
||||
<tabView fixedFrame="YES" initialItem="MIJ-kl-tQe" translatesAutoresizingMaskIntoConstraints="NO" id="Zi9-hf-1KA">
|
||||
<rect key="frame" x="13" y="2" width="712" height="463"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
|
||||
17
OTRS-Watch/Extension/Date.swift
Normal file
17
OTRS-Watch/Extension/Date.swift
Normal file
@ -0,0 +1,17 @@
|
||||
//
|
||||
// Date.swift
|
||||
// OTRS-Watch
|
||||
//
|
||||
// Created by Gerrit Linnemann on 16.12.16.
|
||||
// Copyright © 2016 Adawim UG (haftungsbeschränkt). All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Date {
|
||||
func toString() -> String {
|
||||
let dateFormatter = DateFormatter()
|
||||
dateFormatter.dateFormat = "dd.MM.yyyy hh:mm"
|
||||
return dateFormatter.string(from: self)
|
||||
}
|
||||
}
|
||||
@ -34,7 +34,7 @@ extension ViewController: NSTableViewDataSource, NSTableViewDelegate {
|
||||
if tableColumn == self.ticketTableView.tableColumns[0] {
|
||||
cellIdentifier = CellIdentifiers.OTRSTicketNumber
|
||||
image = nil
|
||||
text = item.created.description
|
||||
text = item.created.toString()
|
||||
} else if tableColumn == self.ticketTableView.tableColumns[1] {
|
||||
cellIdentifier = CellIdentifiers.OTRSTicketDetails
|
||||
image = nil
|
||||
@ -58,7 +58,7 @@ extension ViewController: NSTableViewDataSource, NSTableViewDelegate {
|
||||
let row = ticketTableView.selectedRow
|
||||
let myTableViewFromNotification = notification.object as! NSTableView
|
||||
|
||||
print(myTableViewFromNotification)
|
||||
print(OTRS.sharedInstance.ticketDictionary[row].title)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ class ViewController: NSViewController {
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
|
||||
ticketTableView.delegate = self
|
||||
ticketTableView.dataSource = self
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user