Module:Birthday:修订间差异

跳转到导航 跳转到搜索
无编辑摘要
无编辑摘要
 
(未显示同一用户的3个中间版本)
第67行: 第67行:
         end
         end


         return string.format("%s (%d)", dateString, age)
         return string.format("%s (%d岁)", dateString, age)
     else
     else
        -- 如果月份是英文,且缺失年份或日期
        if type(birthMonthInput) == "string" and (birthMonthInput:match("^[A-Za-z]+$")) then
            if birthYear and not birthDay then
                return string.format("%s, %d", birthMonthInput, birthYear)  -- 仅年份
            elseif birthDay then
                return string.format("%s %d", birthMonthInput, birthDay)  -- 仅日期
            else
                return string.format("%s", birthMonthInput)  -- 仅月份
            end
        end
       
         -- 如果缺少年份、月份或日期中的任意一个,则只输出日期
         -- 如果缺少年份、月份或日期中的任意一个,则只输出日期
         if birthYear and birthMonth then
         if birthYear and birthMonth then