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

Bug: Age is not correct in Birthday Calendar. #6990 #6997

Merged
merged 1 commit into from
May 7, 2024

Conversation

bigtigerku
Copy link
Contributor

Description & Issue number it closes

Bug: Age is not correct in Birthday Calendar. #6990

Use same date function used in Person::getBirthDate() to create calendar date

Screenshots (if appropriate)

Before
Screenshot 2024-05-04 at 10 52 59 PM

After
Screenshot 2024-05-04 at 10 38 04 PM

How to test the changes?

http://localhost/v2/calendar

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

From local host with

npm run build
num run package
npm run docker-test-start

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@bigtigerku bigtigerku requested a review from a team as a code owner May 5, 2024 05:56
@bigtigerku bigtigerku requested review from respencer, DawoudIO, grayeul, DAcodedBEAT and MrClever and removed request for a team May 5, 2024 05:56
@respencer
Copy link
Contributor

I have confirmed the issue, oddly this PR does not fix the issue for me.

Needs further investigation.

@respencer
Copy link
Contributor

Okay, this is more complicated than it first appeared.

On the calendar you want the age they are going to become, in the year of the calendar view (so not now).

On their profile you want the age they currently are, on the day you look at the profile (so now).

It seems to be relying on the same code, but needs different results.

The calendar view needs to subtracts the calendar view year from the date of birth year, e.g.: 2024 - 2012

The profile using date_diff only clocks over at the end of the day, so if the birthday is today it will show the year 1 less than you would expect. So that needs to be tweaked to, but you only want that to happen on the day.

@respencer
Copy link
Contributor

Okay, it looks good to me.

Found a few other bugs, but that's not due to this PR. This one fixes what it says it does.

@respencer respencer requested a review from DawoudIO May 6, 2024 12:54
Copy link
Contributor

@respencer respencer left a comment

Choose a reason for hiding this comment

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

Looks good to me, and passed my testing.

@DAcodedBEAT DAcodedBEAT added this to the Current (5.8.0) milestone May 7, 2024
@DAcodedBEAT DAcodedBEAT merged commit 32e0a19 into ChurchCRM:master May 7, 2024
3 checks passed
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.

4 participants