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

請問能支援 21 -> 廿一 嗎? #10

Closed
billypchan opened this issue Nov 12, 2018 · 1 comment
Closed

請問能支援 21 -> 廿一 嗎? #10

billypchan opened this issue Nov 12, 2018 · 1 comment

Comments

@billypchan
Copy link

謝謝你的努力,如有轉換陰曆日子的功能,我就可免掉自行轉換了.

@cnwhy
Copy link
Owner

cnwhy commented Nov 12, 2018

不好意思 , 暂时没有, 通过配置也不太好做转换, 原因如下:
20 -> 二十
21 -> 廿一
两个 2 对应的中文不一至.

可以尝试二次转换吧, 参考一下:

function zhLunar(n){
    var encode = Nzh.hk.encodeS;
    if(n<11) return "初"+encode(n);
    if(n>20) return encode(n).replace("二十","廿");
    return encode(n);
}

for(var i=1; i<=30; i++){
    console.log(zhLunar(i));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants