const getXingzuo = (month, day) => {
const s = '魔羯水瓶雙魚白羊金牛雙子巨蟹獅子處女天秤天蠍射手魔羯';
const arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22];
return s.substr(month * 2 - (day < arr[month - 1] ? 2 : 0), 2);
}
month =》 爲陽曆出生月;
day =》 爲陽曆出生日;
const getXingzuo = (month, day) => {
const s = '魔羯水瓶雙魚白羊金牛雙子巨蟹獅子處女天秤天蠍射手魔羯';
const arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22];
return s.substr(month * 2 - (day < arr[month - 1] ? 2 : 0), 2);
}
month =》 爲陽曆出生月;
day =》 爲陽曆出生日;