1

Is there any util in JodaTime to convert day of week (Mon=1, Sun=7) to the java.util constant set (Sun=1, Sat=7)? Or do you really have to write stuff like

return localDate.getDayOfWeek() % 7 + 1;

?

pstobiecki
  • 1,804
  • 1
  • 17
  • 30
  • Seen that thread before, I wish it was a duplicate. stolsvik's asking about getting the first day of the week for a given locale. I'm asking about converting week days between Joda and java.util dates. It's just about the constants, not about switching to another interpretetation of when a week starts. – pstobiecki Nov 12 '13 at 09:57
  • The question may not be the same, but the accepted answer definitely applies to your question as well: "_It does not have the ability to obtain the first day of week,_ __nor to return the day of week index based on any day other than the standard Monday__. _Finally, weeks are always calculated wrt ISO rules._" – Zoltán Nov 12 '13 at 10:53
  • Bit harsh to close as duplicate, valid question. Upvoting. – Mathias Apr 02 '14 at 13:56

0 Answers0