Skip to content

[dateparser] Add feature add_prefer_month_year - #1146

Merged
Gallaecio merged 9 commits into
masterfrom
add-PREFER_MONTH_OF_YEAR-1042
May 16, 2023
Merged

Gallaecio merged 9 commits into
masterfrom
add-PREFER_MONTH_OF_YEAR-1042

Conversation

@adnan-awan

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

Copy link
Copy Markdown
Contributor

Resolves #1042

To do:

  • Add tests for this feature
  • Update the docs

@adnan-awan
adnan-awan requested a review from Gallaecio February 27, 2023 17:19
- 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

@Gallaecio Gallaecio left a comment

Copy link
Copy Markdown
Contributor

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

@Gallaecio Gallaecio left a comment •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

Thanks @Gallaecio for useful suggestion!

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

@Gallaecio Gallaecio left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown

@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