-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show creation date of comments #448
Conversation
43d4292
to
0855997
Compare
@@ -136,10 +137,11 @@ class SectorParser(private val _db: DatabaseWrapper) : JSONWebParser() { | |||
for (i in 0 until jsonComments.length()) { | |||
val jsonComment = jsonComments.getJSONObject(i) | |||
val user = jsonComment.getString("username") | |||
val date = _parseCommentDate(jsonComment.getString("datum")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also an "adatum" field which may contain the date of the latest change. Would this make more sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look into the PHP code of sandsteinklettern.de and for my understanding it is the archive date. It is updated, when the comment gets updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm now prioritizing the adatum
and use datum
as fallback.
* Parse comment date-times in the format yyyy-MM-dd HH:mm:ss | ||
* and return only the date in the format yyyy-MM-dd. | ||
*/ | ||
private fun _parseCommentDate(date: String): String = DateUtils.formatDate(date.split(" ")[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You should add error handling here in case
date
is an empty string.
0855997
to
bb35a84
Compare
Fixes #447