e2openplugin-OpenWebif icon indicating copy to clipboard operation
e2openplugin-OpenWebif copied to clipboard

OWIF AutoTimer preview date format

Open Grumpy-Geoff opened this issue 3 years ago • 9 comments

The date format for the "Start" and "End" fields on the AutoTimer Preview popup is shown in mm/dd/yyyy format. e.g.

Name            Title           Channel         Start           End
Overhaulin'	Overhaulin'	9Rush Perth	5/25/2021 06:55	5/25/2021 08:24

This is inconsistent with the other date formats of OWIF (and the STB itself), which is dd/mm/yyyy. e.g Timers: Overhaulin' Tue 25.05.2021 06:55 - 25.05.2021 08:24 9Rush Perth [Rpt] Cathlene's 1970 Plymouth Barracuda waiting and Movies: Overhaulin' 9Rush Perth / Thu 20.05., 06:55 88:59 min. / 1.72 GB [Rpt] Tony's 1966 A100 Van Tony's '66 Dodge A-100 is long past its salad days. But Chip is about to give it a makeover which will make all those damaging years melt away, and will also give it a turn of speed, it never had before.

Affects both classic and modern views of the AutoTimer preview.

Can the date format follow the STB or browser settings please?

The modern view also has a warped sense of the number of hours in a day -

Autotimer Preview
State   Name            Match text      Channel         Start                   End
OK	Overhaulin'	Overhaulin'	9Rush Perth	Tue 5/25/2021 55:00 AM	same day - 24:00 AM

I've reported that before (#1219)

Grumpy-Geoff avatar May 23 '21 12:05 Grumpy-Geoff

[edited to add context]

Seems start here is picking up mm:ss instead of hh:mm

Unfortunately date formatting is considerably inconsistent across OpenWebif (including begintime/endtime returning serial in one place but formatted string in another). I did some work previously to at least try bring long/short/other formats into line whilst also using fuzzydate (eg. tomorrow), along with a proposal to return a begintimeformatted/endtimeformatted key to ajax responses (changing the return format of existing keys is likely to break api consumers' expectations), but there were comments against some of it.

In my opinion, OpenWebIf should follow all date formats set by the user in Enigma2.

wedebe avatar May 23 '21 13:05 wedebe

The biggest problem here is fuzzydate because this function is not equal on each image.

jbleyel avatar May 23 '21 13:05 jbleyel

[edited]

@Grumpy-Geoff, could you attach the values you find in the /etc/enigma2/settings file which start with config.usage.date., please?

E.g.:

config.usage.date.compact=%-d %b 
config.usage.date.compressed=%-d%b 
config.usage.date.displayday=%a %-d %b

Also, what date&time format does your browser usually display on websites?

I see Mon 24/05/2021 21:00 for a similar Start entry on my setup.

Re-iterating my previous point, getting OWIF to spit out an already-formatted-per-box-setting value would save a lot of - for want of a better word - crap 😬

https://stackoverflow.com/a/43365158

wedebe avatar May 23 '21 18:05 wedebe

@Grumpy-Geoff, could you attach the values you find in the /etc/enigma2/settings file which start with config.usage.date., please?

root@beyonwizu4:~# grep config.usage.date /etc/enigma2/settings
config.usage.date.compact=%-d %b
config.usage.date.compressed=%-d%b
config.usage.date.dayfull=%A %d/%m/%Y
config.usage.date.daylong=%a %d/%m/%Y
config.usage.date.dayshort=%a %d/%m
config.usage.date.dayshortfull=%A %d/%m
config.usage.date.daysmall=%a %d
config.usage.date.displayday=%a %-d %b
config.usage.date.full=%d/%m/%Y
config.usage.date.long=%d/%m/%Y
config.usage.date.short=%d/%m
config.usage.date.shortdayfull=%a %d/%m/%Y
root@beyonwizu4:~#

Also, what date&time format does your browser usually display on websites?

I don't know how to answer that, won't it be website dependent? If I go to https://www.timeanddate.com/date/duration.html then the date entry fields are in dd/mm/yyyy order.

Grumpy-Geoff avatar May 24 '21 01:05 Grumpy-Geoff

Hi @wedebe , here my settings

config.usage.date.compact=%-d %b
config.usage.date.compressed=%-d%b
config.usage.date.daylong=%a %d.%m.%Y
config.usage.date.dayshort=%a %d.%m
config.usage.date.dayshortfull=%A %d.%m
config.usage.date.daysmall=%a %d
config.usage.date.displayday=%a %-d %b
config.usage.date.full=%d.%m.%Y
config.usage.date.long=%d.%m.%Y
config.usage.date.short=%d.%m
config.usage.date.shortdayfull=%a %d.%m.%Y

jbleyel avatar May 24 '21 07:05 jbleyel

Please check this :

-> https://github.com/openatv/enigma2/blob/6.4/lib/python/Tools/FuzzyDate.py -> https://github.com/openpli/enigma2/blob/master/lib/python/Tools/FuzzyDate.py -> https://bitbucket.org/beyonwiz/easy-ui-4/src/master/lib/python/Tools/FuzzyDate.py

jbleyel avatar May 24 '21 07:05 jbleyel

Thanks for those settings - way more than I have!

Perhaps moving the recently-added FuzzyTime2 code from movies.py back to utilities.py and leveraging that across OWIF would bring a good deal of consistency? (why was that fn moved btw?) https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/commit/932c505a44fd295960869c48b144817af63a40d9

wedebe avatar May 24 '21 13:05 wedebe

FuzzyTime2 and FuzzyTime is not the same and FuzzyTime2 is only for movies and FuzzyTime is only for timers. Therefore i have moved back the code out of utilities.

jbleyel avatar May 24 '21 13:05 jbleyel

So right now we've got OWIF FuzzyTime OWIF FuzzyTime2 OATV FuzzyTime OPLI FuzzyTime and BWIZ FuzzyTime , all of which differ slightly? 🙈

wedebe avatar May 24 '21 13:05 wedebe