Module:Date: Difference between revisions

Jump to navigation Jump to search
Sur (talk | contribs)
m format_date > p.format_date
Sur (talk | contribs)
m input date format from mm-dd-yyyy -> yyyy-mm-dd
 
Line 7: Line 7:


function p.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