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

Use rolling window for translating 2-digit years into 4-digit years #22581

Merged

Conversation

highfalutin
Copy link
Contributor

@highfalutin highfalutin commented Jan 20, 2022

Overview

Fix outdated hard-coded import logic: translate 2-digit years to 4 using rolling -95yr to +5yr window

Before

1/1/22 is imported as 1922-01-01

After

1/1/22 is imported as 2022-01-01

and, if this code is still running in 2096, 1/1/1 will be imported at 2101-01-01

Comments

See https://lab.civicrm.org/dev/core/-/issues/3037#note_68816

@civibot
Copy link

civibot bot commented Jan 20, 2022

(Standard links)

@civibot civibot bot added the master label Jan 20, 2022
@colemanw
Copy link
Member

@highfalutin can you try out #22580 - if that works for you then it's a better long-term solution.

@colemanw
Copy link
Member

@highfalutin can you please squash these 3 commits down to 1?

@highfalutin highfalutin force-pushed the feature/issue-3037/two-digit-year-import branch from 83aece4 to 3027c16 Compare January 20, 2022 02:33
@highfalutin highfalutin changed the title import 2-digit years up to 27 as 20xx, 2-digit years above 27 as 19xx Use rolling window for translating 2-digit years into 4-digit years Jan 20, 2022
@highfalutin
Copy link
Contributor Author

@colemanw done

@eileenmcnaughton
Copy link
Contributor

@colemanw this is mergeable isn't it?

@eileenmcnaughton
Copy link
Contributor

Actually @seamuslee001 @colemanw we should possibly backport this - it seems the existence of 2022 is a regression - which makes sense.

@colemanw
Copy link
Member

I'm not sure we can backport this to the year 2020, and I don't think I want to relive that year again either 😝

@colemanw colemanw merged commit c5150c3 into civicrm:master Jan 20, 2022
@highfalutin highfalutin deleted the feature/issue-3037/two-digit-year-import branch October 3, 2023 21:30
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.

3 participants