Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
bda4dd3e
Commit
bda4dd3e
authored
Mar 17, 2018
by
Sajal Narang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix type conversion bug
parent
933a0165
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
.idea/misc.xml
.idea/misc.xml
+1
-1
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Converters.java
...ain/java/in/ac/iitb/gymkhana/iitbapp/data/Converters.java
+14
-0
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Event.java
...src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Event.java
+0
-1
No files found.
.idea/misc.xml
View file @
bda4dd3e
...
...
@@ -24,7 +24,7 @@
</value>
</option>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_7"
default=
"true"
project-jdk-name=
"1.8
(1)
"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_7"
default=
"true"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Converters.java
View file @
bda4dd3e
...
...
@@ -6,7 +6,9 @@ import com.google.gson.Gson;
import
com.google.gson.reflect.TypeToken
;
import
java.lang.reflect.Type
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -63,4 +65,16 @@ public class Converters {
String
json
=
gson
.
toJson
(
list
);
return
json
;
}
@TypeConverter
public
static
Timestamp
timestampfromString
(
String
value
)
{
return
new
Gson
().
fromJson
(
value
,
Timestamp
.
class
);
}
@TypeConverter
public
static
String
stringfromTimestamp
(
Timestamp
timestamp
)
{
Gson
gson
=
new
Gson
();
String
json
=
gson
.
toJson
(
timestamp
);
return
json
;
}
}
\ No newline at end of file
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Event.java
View file @
bda4dd3e
...
...
@@ -15,7 +15,6 @@ public class Event {
@PrimaryKey
(
autoGenerate
=
true
)
int
db_id
;
@ColumnInfo
(
name
=
"id"
)
@SerializedName
(
"id"
)
String
eventID
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment