Author Topic: 12 vs. 24 hour date in reply quoting header  (Read 10297 times)

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Anonymous forward uses 12 hour date
« Reply #15 on: September 16, 2016, 05:55:26 pm »
And just in case: I do not see any difference between forward vs forward-anonymous vs reply. In all those cases 12-h format shows up.

And since oneeyed has subsequently reported that the wrong format shows up in all 3 cases (see the quote below), I think the initially observed differences (if any) are just an indication that it is some unstable behavior of some portion of the code.
The fact that some "voodoo" steps help to "correct" the wrong behavior for a while, and then it turns back, also point to the instability.

On the same device (Nexus 5X using Android 7.0), without altering anything in settings between repeated runs of both applications (both killing and not killing them in-between), AquaMail displays "15 septembre 2016 9:49:15 PM" when anonforwarding/regularforwarding/replying, and DateTest (the test application) "15 septembre 2016 21:49:15".

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Anonymous forward uses 12 hour date
« Reply #16 on: September 16, 2016, 06:01:04 pm »
There are places in my code where I use Android (not Java) date formatting.

For example:

      String header = DateUtils.formatDateTime(context, when, DateUtils.FORMAT_SHOW_DATE
            | DateUtils.FORMAT_SHOW_WEEKDAY | DateUtils.FORMAT_ABBREV_WEEKDAY | DateUtils.FORMAT_ABBREV_MONTH);


Or

sWhen = DateUtils.formatDateTime(context, lWhen, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_ALL);

... = DateFormat.is24HourFormat(mContext)


The above snippets are from message list view.

And in message view:

      if (DateUtils.isToday(h.when)) {
         shortWhen = DateUtils.formatDateTime(context, h.when, DateUtils.FORMAT_SHOW_TIME);
      } else {
         shortWhen = DateUtils.formatDateTime(context, h.when, DateUtils.FORMAT_SHOW_TIME
               | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_ALL);
      }


I wonder if calling these -- Android -- date/time formatting functions has side effects?

Either DateUtils.formatDateTime with some flags, or even DateFormat.is24HourFormat?

As to the "forward" vs. "anon", one is in the icon bar, the other is in the menu -- wonder if there could be subtle timing differences?
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

oneeyed

  • Guest
Re: Anonymous forward uses 12 hour date
« Reply #17 on: September 16, 2016, 06:07:23 pm »
Don't read too much into the title of this thread: I reported it against anonymous forwarding because that's what I was currently using when I noticed the problem. I never intended to imply that other use cases gave different results, I just had not tried them at this time.

Don't hesitate to relabel the thread to remove such ambiguity.