Module:Date: Difference between revisions

Sur (talk | contribs)
initial
 
Sur (talk | contribs)
m input date format from mm-dd-yyyy -> yyyy-mm-dd
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
}
}


local function format_date(date_string)
function p.format_date(date_string)
     -- Split the date string into month, day, and year
     -- Split the date string
     local month, day, year = date_string:match("(%d%d)-(%d%d)-(%d%d%d%d)")
     local year, month, day = date_string:match("(%d%d%d%d)-(%d%d)-(%d%d)")
      
      
     if month and day and year then
     if month and day and year then