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

[REF] Fix Test fails on import by ensuring that Month Abbreviations a… #24100

Merged
merged 1 commit into from
Jul 31, 2022

Conversation

seamuslee001
Copy link
Contributor

…re formatted based on the first of each month

Overview

This fixes an issue where by strtotime by default will use the current day which means that the wrong abbreviation for September will show if the tests run on 31 July for example

Before

Import Date validation Test fails when run on 31 July

After

Import Date test passes no matter what date the test is run on

ping @demeritcowboy @eileenmcnaughton

…re formatted based on the first of each month
@civibot
Copy link

civibot bot commented Jul 31, 2022

(Standard links)

@civibot civibot bot added the master label Jul 31, 2022
@demeritcowboy demeritcowboy merged commit 121b197 into civicrm:master Jul 31, 2022
@demeritcowboy
Copy link
Contributor

Interesting.
For this fix, I'm not sure how strtotime decides how to parse things that can be written differently in different locales (e.g. here we would write it "January 1") but it seems to get it right either way, so 👍. If we wanted to be super-sure we could switch to using mktime().

@eileenmcnaughton eileenmcnaughton deleted the fix_date_format branch July 31, 2022 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants