Use an arithmetic operations in a tag expression

Wrong WW 2022-10-24_100438
Hi, probably I faced with this bug in WFS.
I use this tag expression to encrease Week in Year value : ([WEEK_IN_YEAR]+1);
In result it shows correct value exsept on Sunday: instead of add one day to Week in Year it shows at Sunday previos Week value and it continue correct on Monday … till the next Sunday.

Hello,
I dont know whether WFS adjusts this for different languages, but in GWS there was the week days counting dependent on language settings for the text field. In my country for example we count weeks from monday to sunday, while some others count from sunday to saturday. Also we count this week for 43rd not 44th.
Identify the first day of the week based on the locale (salesforce.com)

Hi, Peter, thanks for your response. I didn’t change any default settings in WFS and use it as is. The same setting in GWS gives the desired results. Here is the the wrong calculation that can’t be explained by language/ region settings - everithing go correct exsept one specific issue… I don’t know how to correct it , but I guess it may be resolved… Thanks

Disregarding religious calendars but talking about business calendars…

The Tag should say local week of year. in the America’s and Korea Sunday is the first day of the week. In almost all of the rest of the world Monday is the first day of the week.

Likewise Week of the Year is localized and in the Americas and Korea the week that includes Jan 1 is Week 1 of the year but in the rest of the world the Week with 4 days of the new year is Week 1.

I don’t know if Watch Face Studio reflects the local time settings or uses the America’s calendar.

I hope this doesn’t just add to the confusion, I just find it interesting and has been part of GWD GWS and now WFS.

Ron
Samsung Developer Relations

I think it can be done to suit you, but so far I could figure out only formula that works until 30.12.2023
week ([YEAR_S]==22?([DAY_WEEK]==1?[WEEK_IN_YEAR]+2:[WEEK_IN_YEAR]+1):([DAY_WEEK]==1?([WEEK_IN_YEAR]+52)%52+1:[WEEK_IN_YEAR]))

1 Like

Hi, Peter
Thank you a lot! As you can see it realy works. This watchface specific for IT corporate workers that live with this work week calendar. Actually there are only 52 weeks in IT’s year. But the next 2023 start with correct work week day. Great job!

@lma1581581315

Are you just overthinking this?

Add a digital clock Date
instead of sync to device
if you want the work week to start on Sunday set the time zone for New York
if you want the work week to start on Monday set the time zone to London
for the text field
([WEEK_IN_YEAR])
Work day starting on Monday

By the way anywhere in the world for taxes and accounting the work week starts on Monday not Sunday.
If you want the work day to start on Monday you will need to have something like
WW ((([DAY_WEEK])== 1) ? 7 : (([DAY_WEEK]) -1))
It doesn’t seem to reflect the time zone setting.

Ron
Samsung Developer Relations

1 Like

Thanks a lot Ron!
According to Saleforce " Identify the first day of the week based on the locale"
Publish Date: Jan 5, 2021

|Sundat-Saturday |119| locales
|Monday- Sunday |90| locales
|Saturday-Friday |16| locales

The most spread S-S/ M-S. I guess the right way to choose start day of week is to customize it by demand.

Week number according to the ISO-8601 standard, weeks starting on Monday

Even in the US where the calendar is Sunday - Saturday for most businesses the work week is Monday to Sunday for accounting purposes.

Ron
Samsung Developer Relations

1 Like