Override the first day of the week in iodine?

Is it possible to redefine the first day of the week Joda on Sunday ? since Yoda uses Monday as his first day of the week. Can someone explain to me if there is a way.

I mentioned below topic in SOF

Joda's time: first day of the week?

thanks

+4
source share
1 answer

No.

First of all, redefining the first day of the week on Sunday will require rewriting all the other weekdays. But these final constants are defined in the DateTimeConstants class, which cannot be rewritten. But you would not want to redefine these values ​​anyway, because that would ruin the joda-time ISO standards.

At the same time, I wonder why you would like to redefine it in the first place? Can you provide a usage example?

public static DateTime getUSFirstDayOfWeek(DateTime dateTime) { return dateTime.withDayOfWeek(DateTimeConstants.MONDAY).minusDays(1); } 

This simple helper method is likely to do the job. Please note that I did not use SUNDAY because it would be in the future, that is - in the concept of the USA - next week.

+3
source

All Articles