Slide 30
Slide 30 text
ࢀߟ
• ྫ֎ॲཧΛΘͣʹࡁΉํ๏͕͋ΕͦΕΛ͏͖
def convert_heisei_to_date(heisei_text)
m = heisei_text.match(/ฏ(?\d+)(?\d+)݄(?\d+)/)
year = m[:jp_year].to_i + 1988
month = m[:month].to_i
day = m[:day].to_i
# ྫ֎ॲཧͰͳ͘ɺ݅ذΛ͏
if Date.valid_date?(year, month, day)
Date.new(year, month, day)
end
end