Moving from 7.2 to 25.8 calc format "M/D" not working

On Raspberry PI Debian trixie moving from 7.2 to 25.8 calc format “M/D” not working.
In a macro building the weeks average the top cell which is the date for daily entries and I’ve been filling that top cell for weekly averages with this code:

Blockquote
’ date for weekly average
monStr = cDate(cellRC(DateRow, wkAvgCol - daysInWeek).Value) ’ typical 5 day week
monStr = format( monStr, “M/D” ) ’ 7/10 (/2017)
friStr = cDate(cellRC(DateRow, wkAvgCol - 1).Value)
friStr = format( friStr, “M/D/YY” )
cellRC(DateRow, wkAvgCol).Formula = monStr + " " + friStr

This has put this “12/22 12/26/25” in the top cell of the weeks averages.
Since the upgrade to 25.8 I now get “12/22/2025 12/26/2025”
Though I don’t see how it could make a difference in the spreadsheet Monday’s and Friday’s dates are displayed as “M/D”
Pointers appreciated and Happy Holidays,
Mike

maybe:

cellRC(DateRow, wkAvgCol).String = monStr + " " + friStr

Hello!
In this case, we’re in the world of LO Basic (not Calc).
Format function interprets “M/D” as the “standard” format and displays the date according to the locale. For me,

 Msgbox Format(Now(), "M/D" )

shows 27.12.
To avoid such effects, we can mask the characters separating the date components. For example:

 Msgbox Format(Now(), "M\/D" )

shows 12/27 in any locale.

Version: 25.8.3.2 (X86_64)
Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e
CPU threads: 6; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: CL threaded

karolus and sokol92 thank you for your suggestions unfortunately neither helped.
Thinking that perhaps having the whole row formated as “M/D” was the culprit I looked for a way to set that cell as text but didn’t find that.
Further exploration of the code setting a breakpoint on the line that does the cell assignment I noticed:
monStr = format( monStr, “M/D” )
is not formatting the date so I changed that line to:
mStr = format( monStr, “M/D” )
That didn’t help either.
This little snippet of code has been working for years.
Suggestions?
Happy Holidays,
Mike

Considering soko;92’s response perhaps this is a Debian problem rather than LO, so let’s shelve this for now and I’l go ask there if any are seeing the same.
Be Well,
Mike

Attachment?

This is in large file with several years data so quite a challenge to strip out the data others have no need to see however I did that a while back and posted it on this page:
That didn’t work so downloaded it to re-upload here:
stocksMini.ods (106.5 KB)
Look at Standard/stocks/weeksAverage().

Be Well,
Mike

Your spreadsheet is incomprehensible to me. Your 5 lines of code juggles a wild mixture of strings, dates and doubles.
The second row monStr = format( monStr, “M/D” ) fails to convert a Basic value of type Date into a formatted string.