Hi, I’m using WFS 1.5.7 beta to create my first watch face on my Galaxy Watch6 Classic.
I’d like to add a Date component that looks like this:
Thu, 24 August
But where the formatting of the date will change based on the device language.
For example: on my Galaxy S23, if I change the phone’s language to English (United Kingdom), then the lockscreen date says Thu, 24 August.
But if I change the phone’s language to English (United States), then the lockscreen date says Thu, August 24.
So I want the date of my watch face to behave the same way, ie. changing its format based on the watch’s device language (which is itself synced from my phone).
Here is a way to “sneak it” because the US is not on 24 hour time
Create two text boxes and group them together then move and size them to what you want
First one tag is for most of the world that uses 24 hour time and Day Month Year format
[DAY_WEEK_S], [DAY_1_31_Z] [MON_S]
for the color opacity use this tag (be sure to remove the default 100% so it is only the tag)
[IS_24H] ? 100 : 0
Second one use US Time
[DAY_WEEK_S], [MON_S] [DAY_1_31_Z]
and opacity is [IS_24H] ? 0 : 100
That way if you are in the US which is one of the few countries that uses Month Day Year format
Hi, thanks for the helpful answer! I wasn’t aware of the LANG_LOC tag but it looks like it should do the trick.
As I understand it, your solution means that I need to have two separate date components, right? One formatted the US way, and the other formatted the UK way, and then I use the tag for each one to set its respective opacity?
Won’t that result in additional battery drain though, to have two date components instead of just one?
I guess there’s no way to achieve this with just a single date component.
Hi Ron, thanks for the suggestion. Unfortunately a solution based on 24 vs 12 hour time, wouldn’t really solve my goal, because although the USA is the only country in the world that uses MM-DD-YY, it is not the only country that uses 12 hour time.
There are other countries that use the international DD-MM-YY format, but also use 12 hour time - such as New Zealand, Australia, and the United Kingdom.
Plus, on Samsung smartphones (such as my Galaxy S23), there is a separate setting for “Use 24-hour format” found under Settings > General Management > Date and Time, which is independant of the device language setting.
So I need a solution that is based on the device’s language setting, not based on whether a 12 hour clock is used.
Is there any reason why WFS doesn’t have a native solution for showing the date using the device’s language format? Or is there a plan to add this in the future? After all, Android itself natively supports this functionality on smartphones, so why not the watch?
Hi again, I’ve been playing around with ternary operators, as documented at the bottom of this page:
In theory, I should be able to use a ternary operator inside a single date or text field, using [LANG_LOC]==“en_US” as the conditional_operation, and output either the USA or non-USA date format based on this conditional. This would mean I can have just one date/text field, instead of needing two of them and manipulating the opacity of each one.
However, I’m stuck with this and I wonder if I’ve encountered a bug.
For example, this works correctly:
(([LANG_LOC]==“en_US”) ? “USA” : “Not USA”)
And so does this, using a single tag for the “result_if_true” result:
(([LANG_LOC]==“en_US”) ? [MON_F] : “Not USA”)
But if I try to add more than one tag for the “result_if_true” or “result_is_false”, then it doesn’t work and just outputs the entire ternary operator:
Hi Ron, I’m not sure what you mean. There is only one question mark in a ternary operation, per the documentation at Tag expressions | Samsung Developers
For some reason I can’t get your tag expression to work on my watch (Galaxy Watch 6 Classic).
I’ve copied it verbatim into the Text Field part of my Date component, and when I change the language in the Run panel inside WFS, then the date format changes correctly in the Run panel’s preview.
But when I push the watch face to my watch, and then change the language on my phone, it doesn’t change the format on the watch.
I’ve also tried reducing it down to the following for simplicity, but no luck:
Using the above string, if the phone’s language is set to either “English (United States)” or “English (Canada)”, then the watch will show the date as:
Wed, November 1
And if the phone’s language is anything else, then the watch will show the date as:
Wed, 1 November
Thus, the watch always matches the phone. I’ve only used US and Canadian English in my string because AFAIK they are the only two countries that use the Month/Day format on Android, rather than Day/Month.