Mailing List Archive

Web App select time format in program listings
Hallo,
Does anybody know how to set the time format to 24 hours instead of 12
am/pm format ?
In the program listings tab, I always see the 12 hours format.
I tried to change language to "german" and setting the locale "LC_TIME" to
"de.AT-UTF-8"
but nothing helps.
In the mythbackend logs, I see "Setting QT default locale to de_AT".
The terminal display the `date` command correctly in the 24 hours format.

Roland
Re: Web App select time format in program listings [ In reply to ]
On 11/21/2023 1:41 PM, Roland Ernst wrote:
> Hallo,
> Does anybody know how to set the time format to 24 hours instead of 12
> am/pm format ?
> In the program listings tab, I always see the 12 hours format.
> I tried to change language to "german" and setting the locale
> "LC_TIME" to "de.AT-UTF-8"
> but nothing helps.
> In the mythbackend logs, I see "Setting QT default locale to de_AT".
> The terminal display the `date` command correctly in the 24 hours format.
>
> Roland
>
It's in mythfrontend: Setup->Appearance->Localization.

FWIW, I think you might have gotten an answer sooner if you had directed
this question to the mythtv-users list.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Web App select time format in program listings [ In reply to ]
On 11/21/23 13:41, Roland Ernst wrote:
> Hallo,
> Does anybody know how to set the time format to 24 hours instead of 12
> am/pm format ?
> In the program listings tab, I always see the 12 hours format.
> I tried to change language to "german" and setting the locale
> "LC_TIME" to "de.AT-UTF-8"
> but nothing helps.
> In the mythbackend logs, I see "Setting QT default locale to de_AT".
> The terminal display the `date` command correctly in the 24 hours format.
>
> Roland
>
>
>
Hi Roland

in src/app/services/utility.service.ts

I used toLocaleTimeString, which should have given an appropriate format
for the locale

  formatTime(date: string): string {
    if (!date)
      return '';
    // Get the locale specific time and remove the seconds
    const t = new Date(date);
    const tWithSecs = t.toLocaleTimeString() + ' ';
    return tWithSecs.replace(/:.. /, '');
  }

Maybe we need to customize that somewhere. Is there a setting to tell
which format is needed?

If you would like me to change it open a ticket for me.

Peter

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Web App select time format in program listings [ In reply to ]
On 2023/11/21 17:50, faginbagin wrote:
> On 11/21/2023 1:41 PM, Roland Ernst wrote:
>> Hallo,
>> Does anybody know how to set the time format to 24 hours instead of
>> 12 am/pm format ?
>> In the program listings tab, I always see the 12 hours format.
>> I tried to change language to "german" and setting the locale
>> "LC_TIME" to "de.AT-UTF-8"
>> but nothing helps.
>> In the mythbackend logs, I see "Setting QT default locale to de_AT".
>> The terminal display the `date` command correctly in the 24 hours
>> format.
>>
>> Roland
>>
> It's in mythfrontend: Setup->Appearance->Localization.
>
> FWIW, I think you might have gotten an answer sooner if you had
> directed this question to the mythtv-users list.
> _______________________________________________
>
I think he was specifically looking for a setting for the web app, which
does not use the MythTV locale setting (but perhaps it should).

Peter

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Web App select time format in program listings [ In reply to ]
On 11/21/2023 6:25 PM, Peter Bennett wrote:
>
> On 2023/11/21 17:50, faginbagin wrote:
>> On 11/21/2023 1:41 PM, Roland Ernst wrote:
>>> Hallo,
>>> Does anybody know how to set the time format to 24 hours instead of
>>> 12 am/pm format ?
>>> In the program listings tab, I always see the 12 hours format.
>>> I tried to change language to "german" and setting the locale
>>> "LC_TIME" to "de.AT-UTF-8"
>>> but nothing helps.
>>> In the mythbackend logs, I see "Setting QT default locale to de_AT".
>>> The terminal display the `date` command correctly in the 24 hours
>>> format.
>>>
>>> Roland
>>>
>> It's in mythfrontend: Setup->Appearance->Localization.
>>
>> FWIW, I think you might have gotten an answer sooner if you had
>> directed this question to the mythtv-users list.
>> _______________________________________________
>>
> I think he was specifically looking for a setting for the web app,
> which does not use the MythTV locale setting (but perhaps it should).
>
> Peter
Oops, my bad! I didn't notice the subject line, only the content. Sorry
for the noise.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Web App select time format in program listings [ In reply to ]
On Wed, Nov 22, 2023 at 12:16?AM Peter Bennett <pb.mythtv@gmail.com> wrote:

>
> On 11/21/23 13:41, Roland Ernst wrote:
> > Hallo,
> > Does anybody know how to set the time format to 24 hours instead of 12
> > am/pm format ?
> > In the program listings tab, I always see the 12 hours format.
> > I tried to change language to "german" and setting the locale
> > "LC_TIME" to "de.AT-UTF-8"
> > but nothing helps.
> > In the mythbackend logs, I see "Setting QT default locale to de_AT".
> > The terminal display the `date` command correctly in the 24 hours format.
> >
> > Roland
> >
> >
> >
> Hi Roland
>
> in src/app/services/utility.service.ts
>
> I used toLocaleTimeString, which should have given an appropriate format
> for the locale
>
> formatTime(date: string): string {
> if (!date)
> return '';
> // Get the locale specific time and remove the seconds
> const t = new Date(date);
> const tWithSecs = t.toLocaleTimeString() + ' ';
> return tWithSecs.replace(/:.. /, '');
> }
>
> Maybe we need to customize that somewhere. Is there a setting to tell
> which format is needed?
>
> If you would like me to change it open a ticket for me.
>
> Peter
>
>
Peter,

thank you for this information.
In essence this means that the web-browser is responsible to display
correct date/time information.
In order to get Firefox to display the date/time information and other
locale settings like
`LC_TIME` and `LC_NUMERIC`
correctly in my language, I needed to set-up Firefox correctly:
Open a new tab in Firefox, type about:config in the address bar and hit
enter,
proceed to agree to the warning message and use the search bar to find
intl.regional_prefs.use_os_locales.
Toggle the flag value to true and restart the browser.

Now, every date/time display works as desired in the web-app..

One reason for setting the locale of the backend server to `en_US.UTF-8` is
that the grabber scripts for themoviedb.org (tmdb3.py and tmdbtv.py) use the
default locale as a second option when they do not find artworks in the
given language,
which is `de` in my case and defaults to `LANG=en_US.UTF-8`.

Thank you for your help and the powerful web-application,

Roland