shortform of weekday possible?

54 views
Skip to first unread message

Astrid

unread,
Mar 28, 2020, 2:32:31 PM3/28/20
to weewx-user
Hello!

I am using weewx 3.9.2, german language.

Is it possible that e.g. for $month.dewpoint.mintime
not to get
Taupunkt min    -9,2 °C    19:50:00 (Mittwoch)
instead to get
Taupunkt min    -9,2 °C    19:50:00 (Mi)
to save a little bit the linelengh?

Regards, Astrid

gjr80

unread,
Mar 29, 2020, 5:51:01 AM3/29/20
to weewx-user
Hi,

Provided your system is set to use the German locale you can display an abbreviated day name using the strptime() %a formatting directive. How you use the %a directive depends on what you want to achieve.

If you have a tag in a template, say $month.dewpoint.mintime and you want it to display just the abbreviated day name then something like $month.dewpoint.mintime.format("%a") will display (just) the abbreviated day name for the time the month minimum dewpoint occurred. I suspect though that the example you have given may in fact come from a template that uses a format that is picked up from the [StdReport] [[Defaults]] [[[Units]]] [[[[TimeFormats]]]] stanza or perhaps a similar stanza in a skin config file (skin.conf). You can certainly change the default setting in the [[[[TimeFormats]]]] stanza but be aware this will likely change the format used throughout a number of templates and skins. So it may not be what you want.

It might help if you tell us which template this is from or show us what template code you are using.

Gary

Astrid

unread,
Mar 30, 2020, 1:35:21 PM3/30/20
to weewx-user
Hello!

Thanx a lot.

I am using niculskin in the moment.

I got my result now with:

.format("%X (%a)")

adding at the end of min/max-value placeholder in skin/tmpl.

So it works now. :)

Taupunkt min    -8,3 °C    07:07:00 (Mo)

Regards, Astrid

Reply all
Reply to author
Forward
0 new messages