CDateFormatter::formatWeekInMonth returns the wrong week number #1990

wstucco opened this Issue Jan 15, 2013 · 1 comment


None yet
2 participants

wstucco commented Jan 15, 2013

formatWeekInMonth returns the month's week number for a specified date, by subtracting the first week of the month to the current week.
But sometimes the first week of the year is just the last week of the previous month (52nd or 53rd week of the previous year) causing the method to return the wrong value.
I think we could just return ceil(day_of_the_month/7).

@ghost ghost assigned resurtm Jun 7, 2013

@resurtm resurtm closed this in 6e632c7 Jun 7, 2013


This comment has been minimized.

Show comment Hide comment

resurtm Jun 7, 2013


@wstucco, thanks for reporting! Fixed.


resurtm commented Jun 7, 2013

@wstucco, thanks for reporting! Fixed.

resurtm added a commit that referenced this issue Jun 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment