Yesterday I received an answer to the question: WEEK_OF_YEAR are incompatible on different machines
(basically learned how WEEK_OF_YEAR is calculated based on firstDayOfWeek and minimumDaysInFirstWeek )
But now I have the following question: what other settings can affect the ability of the Calendar to use the standard locale? Because here is the behavior that I am observing (with the correct locale en_US by default):
Calendar c = Calendar.getInstance();
The result of work:
This looks even more absurd (setDefault for getDefault results ...?!) If I ran this in Clojure (JVM language, so the behavior is exactly the same):
user=> (.getFirstDayOfWeek (java.util.Calendar/getInstance)) 2 user=> (Locale/setDefault (Locale/getDefault)) nil user=> (.getFirstDayOfWeek (java.util.Calendar/getInstance)) 1
The above examples are executed without any JVM arguments, so, to my question, where can I set parameters 2 and 4 for firstDayOfWeek and minimumDaysInWeek? And, perhaps most importantly, how do I fix them forever?
Thanks!
source share