1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-23 20:24:21 +02:00

fix(frontend): 2月29日を誕生日に設定している場合、平年は3月1日を誕生日として扱うように (#17072)

* fix(frontend): 2月29日を誕生日に設定している場合、平年は3月1日を誕生日として扱うように

* Update Changelog

* add tests

* spdx
This commit is contained in:
かっこかり
2026-01-08 12:16:33 +09:00
committed by GitHub
parent 666f78e676
commit cd973b252a
5 changed files with 92 additions and 16 deletions

View File

@@ -186,6 +186,7 @@ import { getStaticImageUrl } from '@/utility/media-proxy.js';
import MkSparkle from '@/components/MkSparkle.vue';
import { prefer } from '@/preferences.js';
import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
import { isBirthday } from '@/utility/is-birthday.js';
function calcAge(birthdate: string): number {
const date = new Date(birthdate);
@@ -319,16 +320,10 @@ function disposeBannerParallaxResizeObserver() {
onMounted(() => {
narrow.value = rootEl.value!.clientWidth < 1000;
if (props.user.birthday) {
const m = new Date().getMonth() + 1;
const d = new Date().getDate();
const bm = parseInt(props.user.birthday.split('-')[1]);
const bd = parseInt(props.user.birthday.split('-')[2]);
if (m === bm && d === bd) {
confetti({
duration: 1000 * 4,
});
}
if (isBirthday(user.value)) {
confetti({
duration: 1000 * 4,
});
}
nextTick(() => {