Last active
December 15, 2015 11:59
-
-
Save celsodantas/5257548 to your computer and use it in GitHub Desktop.
Get first day of the week in GWT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DateTimeConstants constants = LocaleInfo.getCurrentLocale().getDateTimeConstants(); | |
int firstDay = Integer.parseInt(constants.firstDayOfTheWeek()) - 1; | |
int offset = firstDay - date.getDay(); | |
date.setDate(date.getDate() + offset); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment