# Module:Date2en

From faraghaib
Jump to navigation Jump to search

local p = {}

local numConv = require( "Module:Numeral converter" ).convert

-- Use this function from templates. function p.convert_template(frame)

     return p.convert(frame.args[1])

end

-- Use this function directly in modules. function p.convert(text) text = mw.ustring.gsub(text, "ٔ", "") text = mw.ustring.gsub(text, "ژانویه", "January") text = mw.ustring.gsub(text, "فوریه", "February") text = mw.ustring.gsub(text, "مارس", "March") text = mw.ustring.gsub(text, "آوریل", "April") text = mw.ustring.gsub(text, "مه", "May") text = mw.ustring.gsub(text, "ژوئن", "June") text = mw.ustring.gsub(text, "ژوئیه", "July") text = mw.ustring.gsub(text, "اوت", "August") text = mw.ustring.gsub(text, "سپتامبر", "September") text = mw.ustring.gsub(text, "اکتبر", "October") text = mw.ustring.gsub(text, "نوامبر", "November") text = mw.ustring.gsub(text, "دسامبر", "December") text = mw.ustring.gsub(text, "ساعت", "hours") text = mw.ustring.gsub(text, "روز", "days") text = mw.ustring.gsub(text, "هفته", "weeks") text = mw.ustring.gsub(text, "ماه", "months") text = mw.ustring.gsub(text, "سال", "years")

return numConv("en", text) end

return p

Retrieved from "https://en.faraghaib.ir/w/index.php?title=Module:Date2en&oldid=1103"