brief-rss/brief

Date format

Opened this issue · 5 comments

Would it be possible for the date format to:

  • either respect the Firefox locale,
  • or be set in the preferences?

Seeing the month first is really disturbing.

I’m currently using Brief 2.6.0 and Firefox 72.0.2 (64 bit) on Linux, with the Firefox language set to “English (United Kingdom)” and I see dates on items in Brief such as “Dec 2, 2019, 4:00 PM“, so formatted with the US locale.

This is interesting. As the only place that doesn't use toLocaleTimeString is in modules/opml.js which I don't think is used in the general display of feed items. So either 1) The date is constructed manually and thus my simple greps won't find it or 2) toLocaleTimeString isn't doing what it should be.

I don't have time to look deeper at the moment. But I will when I get home. Unless someone else does so first.

Hello :-)

Entry dates are formatted in ui/feedview.js and use the locale from navigator.language. Not sure which exactly preferences / configuration this setting matches. Probably need to revisit this question.

Thanks @tanriol, I added a print in that function to see what happens and the locale returned is en-US.

Turns out brief is not using the Firefox locale but the setting for the Content-language HTTP header, and not the UI Language from browser.i18n.getUILanguage().

I suppose that value is at least a good fallback because the preferred languages list is allowed to be empty, and that crashes brief:

RangeError: invalid language tag: "" feedview.js:1421:38

In the language preferences:
screenshot of the preferences

@Cimbali According to the specifications it's not allowed to be empty. This was found out in #274 and I filed mozilla bug 1415146. Not fixed yet, so a fallback is probably a good idea.