Эх сурвалжийг харах

Small fix on the table Festival_event.

Iñigo Valentin 9 жил өмнө
parent
commit
7698b04101

+ 5 - 2
app/Sync.swift

@@ -1680,8 +1680,11 @@ class Sync{
 			//Get end
 			str = str.subStr(start : str.indexOf(target : ",\"")! + 1, end : str.length - 1)
 			dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
-			let end = dateFormatter.date(from: str.subStr(start : str.indexOf(target : "\"end\":")! + 7, end : str.length - 2))!
-			row.setValue(end, forKey: "end")
+			let strEnd =  str.subStr(start : str.indexOf(target : "\"end\":")! + 7, end : str.length - 2)
+			if (strEnd != "ul"){ //From "null"
+				let end = dateFormatter.date(from: strEnd)!
+				row.setValue(end, forKey: "end")
+			}
 			
 			//Save CoreData
 			do {

+ 2 - 2
app/app.xcdatamodeld/app.xcdatamodel/contents

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="11759" systemVersion="16D32" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
+<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="12141" systemVersion="16E195" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
     <entity name="Activity" representedClassName=".Activity" syncable="YES" codeGenerationType="class">
         <attribute name="after_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="after_es" optional="YES" attributeType="String" syncable="YES"/>
@@ -88,7 +88,7 @@
         <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="end" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
-        <attribute name="gm" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
+        <attribute name="gm" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="host" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="place" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>