We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
the source: @Property def week_of_month(self): first_day_of_month = self.replace(day=1) return self.week_of_year - first_day_of_month.week_of_year + 1
the results eg.:
{'day_wid': '20211229', 'week_wid': '202152', 'week_code': 52, 'week_of_month': 5,} {'day_wid': '20211230', 'week_wid': '202152', 'week_code': 52, 'week_of_month': 5,} {'day_wid': '20211231', 'week_wid': '202152', 'week_code': 52, 'week_of_month': 5,} {'day_wid': '20220101', 'week_wid': '202152', 'week_code': 52, 'week_of_month': 1,} {'day_wid': '20220102', 'week_wid': '202152', 'week_code': 52, 'week_of_month': 1,} {'day_wid': '20220103', 'week_wid': '202201', 'week_code': '01', 'week_of_month': -50,} {'day_wid': '20220104', 'week_wid': '202201', 'week_code': '01', 'week_of_month': -50,}
Thanks🙌 ❤️
The text was updated successfully, but these errors were encountered:
Perhaps this will be fine: @Property def week_of_month(self): first_day_of_month = self.replace(day=1) # return self.week_of_year - first_day_of_month.week_of_year + 1 days = self.day + first_day_of_month.day_of_week-1 return math.ceil(days/7)
Sorry, something went wrong.
Hi @expressways what are you expecting? Can you elaborate more?
Fix behavior of the week_of_month property
week_of_month
84497bb
Fixes #438 Fixes #455 Fixes #536 Fixes #587 Fixes #598 Fixes #718
c811ecd
Successfully merging a pull request may close this issue.
the source:
@Property
def week_of_month(self):
first_day_of_month = self.replace(day=1)
return self.week_of_year - first_day_of_month.week_of_year + 1
the results eg.:
{'day_wid': '20211229', 'week_wid': '202152', 'week_code': 52, 'week_of_month': 5,}
{'day_wid': '20211230', 'week_wid': '202152', 'week_code': 52, 'week_of_month': 5,}
{'day_wid': '20211231', 'week_wid': '202152', 'week_code': 52, 'week_of_month': 5,}
{'day_wid': '20220101', 'week_wid': '202152', 'week_code': 52, 'week_of_month': 1,}
{'day_wid': '20220102', 'week_wid': '202152', 'week_code': 52, 'week_of_month': 1,}
{'day_wid': '20220103', 'week_wid': '202201', 'week_code': '01', 'week_of_month': -50,}
{'day_wid': '20220104', 'week_wid': '202201', 'week_code': '01', 'week_of_month': -50,}
Thanks🙌 ❤️
The text was updated successfully, but these errors were encountered: