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

fix(frontend): 周年の実績が閏年を考慮するように #13525

Merged
merged 6 commits into from
Mar 7, 2024

Conversation

kakkokari-gtyih
Copy link
Contributor

What

月日の一致で周年を判定するように

Why

Fix #13524

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/frontend Client side specific issue/PR label Mar 5, 2024
@kakkokari-gtyih kakkokari-gtyih marked this pull request as ready for review March 5, 2024 11:10
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.67%. Comparing base (08d618b) to head (b53ff6c).

Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #13525       +/-   ##
============================================
+ Coverage    64.69%   77.67%   +12.97%     
============================================
  Files          986      185      -801     
  Lines       110809    25025    -85784     
  Branches      5692      484     -5208     
============================================
- Hits         71691    19438    -52253     
+ Misses       37682     5580    -32102     
+ Partials      1436        7     -1429     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +190 to 210
const createdAt = new Date($i.createdAt);
const createdAtThreeYearsLater = new Date($i.createdAt);
createdAtThreeYearsLater.setFullYear(createdAtThreeYearsLater.getFullYear() + 3);
if (now >= createdAtThreeYearsLater) {
claimAchievement('passedSinceAccountCreated3');
claimAchievement('passedSinceAccountCreated2');
claimAchievement('passedSinceAccountCreated1');
} else {
const createdAtTwoYearsLater = new Date($i.createdAt);
createdAtTwoYearsLater.setFullYear(createdAtTwoYearsLater.getFullYear() + 2);
if (now >= createdAtTwoYearsLater) {
claimAchievement('passedSinceAccountCreated2');
claimAchievement('passedSinceAccountCreated1');
} else {
const createdAtOneYearLater = new Date($i.createdAt);
createdAtOneYearLater.setFullYear(createdAtOneYearLater.getFullYear() + 1);
if (now >= createdAtOneYearLater) {
claimAchievement('passedSinceAccountCreated1');
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dateを量産してしまいそうなので逆順で探知させるようにした(好みの問題)

@syuilo syuilo merged commit f4a5740 into misskey-dev:develop Mar 7, 2024
18 checks passed
@syuilo
Copy link
Member

syuilo commented Mar 7, 2024

👍

@kakkokari-gtyih kakkokari-gtyih deleted the fix-13524 branch March 7, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/frontend Client side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

アカウント開設n周年の実績が閏年を考慮しない
2 participants