-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group_By_Day_Of_Week is off by 1 (Monday returns as Sunday) #202
Comments
Hey @JSanderbeck, check out the section on date columns in the readme to see if that fixes it. |
I tried changing the week start and it just changed what the first day in that chart was. Sunday still contained data... |
But I NEED group_by_day_of_week, not just week... |
The specific function isn't important in the example - it's the |
Anyways, I don't think this is an issue with Groupdate, but happy to revisit if there's more evidence. |
Ok. I understand what you are saying... That worked... |
From a previous issue that was closed without resolution...
I have a chart that shows the number of incidents by the day of the week. The school is only open Monday thru Friday, and I verified all records are in the range of Monday thru Friday, however this line of code draws a chart from Sunday to Thursday.
@records.group_by_day_of_week(:entry_date, week_start: :sun, format: '%a').count
From the description in the previously reported bug, you stated that DAYOFWEEK returns a 1 for Sunday to a 7 for Saturday. This is incorrect in the later releases of Postgresql.
----- From Postgresql Documentation
The function receives the date variable d as its only argument and returns an integer that indicates the day of the week for this date.
0 - Sunday
1 - Monday
2 - Tuesday
3 - Wednesday
4 - Thursday
5 - Friday
6 - Saturday
Any suggestions on a way around this, or is a fix coming?
John
The text was updated successfully, but these errors were encountered: