Skip to content
This repository has been archived by the owner on Jan 25, 2018. It is now read-only.

Ignores system setting "Use 24-hour format" when showing message timestamps #207

Closed
Safari77 opened this issue Mar 15, 2013 · 3 comments
Closed

Comments

@Safari77
Copy link

I have Android 4.0.4, ZTE Blade III.

@Safari77
Copy link
Author

respects system date format (e.g. 2013/04/15 , 04/15/2013, ...) and 12/24 hour format setting.

sometimes there can be ten minutes before gibberbot displays timestamp, they show up when I go back and enter again the chat view.. intentional? and when I scoll the window, timestamps disappear.

gibberbot-system-timestamps

diff --git a/src/info/guardianproject/otr/app/im/app/MessageView.java b/src/info/guardianproject/otr/app/im/app/MessageView.java
index 3694f68..326581e 100644
--- a/src/info/guardianproject/otr/app/im/app/MessageView.java
+++ b/src/info/guardianproject/otr/app/im/app/MessageView.java
@@ -196,8 +196,11 @@ public class MessageView extends LinearLayout {
}

 private SpannableString formatTimeStamp(Date date) {
  •    DateFormat format = new SimpleDateFormat(mResources.getString(R.string.time_stamp));
    
  •    String dateStr = format.format(date);
    
  •    DateFormat dateFormat =
    
  •        android.text.format.DateFormat.getDateFormat(getContext());
    
  •    DateFormat timeFormat =
    
  •        android.text.format.DateFormat.getTimeFormat(getContext());
    
  •    String dateStr = dateFormat.format(date) + " " + timeFormat.format(date);
     SpannableString spanText = new SpannableString(dateStr);
     int len = spanText.length();
     spanText.setSpan(new StyleSpan(Typeface.ITALIC), 0, len, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    

@Safari77
Copy link
Author

LOL, this thing wrecked my patch, I guess I have to figure out some other way to include them

@ghost
Copy link

ghost commented Aug 21, 2014

@Safari77 If you want to send in the patch via the github website the best way is to open the specific file and click the edit button. Then do your change and commit it. Also please file a pull request with your change with a link to this bug report.

I am able to confirm your bug report with chatsecure 13.1.2 on cyanogenMod 10.1.

@n8fr8 n8fr8 closed this as completed May 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants