Hello,
i need some hint about system.date.format.
I need to format date to string like: “dd. MM. YYYY/w”
That w is calendar week. But when I use this function I get Calendar weeks starting by Sunday (so if the date is hits Sunday, KW number is wrong for me).
a) Do you know any elegant way how get KW starting by Monday (some settings or elegant code).
b) There is option to use ifs and add +1 if this is Sunday (but this is plan B for me).
Since system.date.format uses the java SimpleDateFormat and SimpleDateFormat uses the Locale to determine which day is the start of the week, I assume that this is based on the project’s locale?
Java’s Calendar class allows you to set the first day of the week (docs). If you’re comfortable importing classes from Java this would be the easiest way.