Skip to content
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

[dateparser] Add feature add_prefer_month_year #1146

Merged
merged 9 commits into from
May 16, 2023

Conversation

adnan-awan
Copy link
Contributor

@adnan-awan adnan-awan commented Feb 27, 2023

Resolves #1042

To do:

  • Add tests for this feature
  • Update the docs

- Add check to not apply month correction in case of month is given
- #1042
…_YEAR-1042

# Conflicts:
#	dateparser/parser.py
- Resolve conflicts and perform isort
- #1042
Copy link
Member

@Gallaecio Gallaecio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@Gallaecio Gallaecio self-requested a review March 27, 2023 12:44
@adnan-awan adnan-awan force-pushed the add-PREFER_MONTH_OF_YEAR-1042 branch from b31c4c4 to 03710f8 Compare April 28, 2023 09:41
Copy link
Member

@Gallaecio Gallaecio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the testing side, I think it would be good to cover an additional case where the current month has fewer days than the requested month. For example: Input: 2023, Current: April 15th, Preferred: last day, last month, Expected: Dec 31st (i.e. we are making sure it does not cause Dec 30th).

- For example: Input: 2023, Current: April 15th, Preferred: last day, last month, Expected: Dec 31st (i.e. we are making sure it does not cause Dec 30th).
- #1042
@adnan-awan
Copy link
Contributor Author

Thanks @Gallaecio for useful suggestion!

I've added the suggested test. Would you please review it again?

Copy link
Member

@Gallaecio Gallaecio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Gallaecio Gallaecio requested a review from serhii73 May 3, 2023 07:13
@Gallaecio Gallaecio merged commit 0056c88 into master May 16, 2023
@adnan-awan adnan-awan deleted the add-PREFER_MONTH_OF_YEAR-1042 branch June 1, 2023 20:14
jimbofreedman pushed a commit to jimbofreedman/dateparser that referenced this pull request Jul 4, 2023
@anuj1508
Copy link

@Gallaecio Just checking on when are you planning to push a new release which includes above changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is there a PREFER_MONTH_OF_YEAR also?
4 participants