<!-- Hi there! Thank you for discovering and submitting an issue. Before you submit this; let's make sure of a few things. Please make sure the following boxes are ticked if they are correct. If not, please try and fulfill these first. --> <!-- Checked checkbox should look like this: [x] --> - [ ] I am on the [latest](https://github.com/sdispater/pendulum/releases/latest) Pendulum version. - [ ] I have searched the [issues](https://github.com/sdispater/pendulum/issues) of this repo and believe that this is not a duplicate. <!-- Once those are done, if you're able to fill in the following list with your information, it'd be very helpful to whoever handles the issue. --> - **OS version and name**: Ubuntu 20.04.2 LTS - **Pendulum version**: <!-- Replace with version --> ## Issue <!-- Now feel free to write your issue, but please be descriptive! Thanks again 🙌 ❤️ --> Try running this code. You will notice that ```week_of_month``` returns negative values. ``` import pendulum from datetime import datetime problematic_dates = ['2021-01-30 00:00:00', '2021-01-29 00:00:00', '2021-01-28 00:00:00', '2021-01-27 00:00:00', '2021-01-26 00:00:00', '2021-01-25 00:00:00', '2021-01-23 00:00:00', '2021-01-22 00:00:00', '2021-01-21 00:00:00', '2021-01-20 00:00:00', '2021-01-19 00:00:00', '2021-01-18 00:00:00', '2021-01-15 00:00:00', '2021-01-14 00:00:00', '2021-01-13 00:00:00', '2021-01-12 00:00:00', '2021-01-11 00:00:00', '2021-01-09 00:00:00', '2021-01-08 00:00:00', '2021-01-07 00:00:00', '2021-01-06 00:00:00', '2021-01-05 00:00:00', '2021-01-04 00:00:00', '2019-12-31 00:00:00', '2019-12-30 00:00:00'] for x in problematic_dates: x = datetime.strptime(x, '%Y-%m-%d %H:%M:%S') week_num_of_the_month = pendulum.parse((x.strftime('%Y') + x.strftime('%m') + x.strftime('%d'))).week_of_month print(f'{x}: {week_num_of_the_month}') ``` **OUTPUT:** ``` 2021-01-30 00:00:00: -48 2021-01-29 00:00:00: -48 2021-01-28 00:00:00: -48 2021-01-27 00:00:00: -48 2021-01-26 00:00:00: -48 2021-01-25 00:00:00: -48 2021-01-23 00:00:00: -49 2021-01-22 00:00:00: -49 2021-01-21 00:00:00: -49 2021-01-20 00:00:00: -49 2021-01-19 00:00:00: -49 2021-01-18 00:00:00: -49 2021-01-15 00:00:00: -50 2021-01-14 00:00:00: -50 2021-01-13 00:00:00: -50 2021-01-12 00:00:00: -50 2021-01-11 00:00:00: -50 2021-01-09 00:00:00: -51 2021-01-08 00:00:00: -51 2021-01-07 00:00:00: -51 2021-01-06 00:00:00: -51 2021-01-05 00:00:00: -51 2021-01-04 00:00:00: -51 2019-12-31 00:00:00: -46 2019-12-30 00:00:00: -46 ```
Activity
Fix behavior of the `week_of_month` property
Fix behavior of the `week_of_month` property (#774)