Module:Time/data/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 8:
 
local cfg = {
---- default date format ----
['default_df'] = 'mdy', -- default date format when |<df> and |df= omitted or empty
 
---- error messages ----
['err_msg'] = '<span style="font-size:100%" class="error">{{time}} – $1 ([[Template:Time#Error messages|help]])</span>',
['err_text'] = {
Line 19 ⟶ 24:
['unknown_tz'] = 'unknown timezone $1',
},
-- for dst calculations
---- formats table ----
local formats = { -- output formatting strings
t12 = 'g:i a', -- time only
t24 = 'H:i',
iso_date ='Y-m-d', -- date only
dmy_date = 'j F Y',
mdy_date = 'F j, Y',
-- ymd_date = 'Y F j', -- not permitted at en.wiki per [[MOS:DATESNO]] - not currently supported
dmy12 = 'g:i a, j F Y', -- 12hr time and date
mdy12 = 'g:i a, F j, Y',
dmy = 'H:i, j F Y', -- 24hr time and date
mdy = 'H:i, F j, Y',
iso = 'Y-m-d"T"H:i',
dow = 'l', -- day of the week
min = 'i', -- hour or minute only
h12 = 'g',
h24 = 'H',
},
---- for dst calculations ----
days = {['sunday'] = 0, ['monday'] = 1, ['tuesday'] = 2, ['wednesday'] = 3, ['thursday'] = 4, ['friday'] = 5, ['saturday'] = 6},
months = {['january'] = 1, ['february'] = 2, ['march'] = 3, ['april'] = 4, ['may'] = 5, ['june'] = 6, ['july'] = 7, ['august'] = 8, ['september'] = 9, ['october'] = 10, ['november'] = 11, ['december'] = 12};
ordinals = {['1st'] = 1, ['first'] = 1, ['2nd'] = 2, ['second'] = 2, ['3rd'] = 3, ['third'] = 3, ['4th'] = 4, ['fourth'] = 4, ['5th'] = 5, ['fifth'] = 5, ['last'] = -1},
 
---- parameter listand parameter aliases table ----
aliases = {
['df'] = {'df','format'},
Line 36 ⟶ 69:
}
 
--[[--------------------------< F O R M A T S >----------------------------------------------------------------
 
]]
 
local formats = { -- output formatting strings
t12 = 'g:i a', -- time only
t24 = 'H:i',
iso_date ='Y-m-d', -- date only
dmy_date = 'j F Y',
mdy_date = 'F j, Y',
-- ymd_date = 'Y F j', -- not permitted at en.wiki per [[MOS:DATESNO]] - not currently supported
dmy12 = 'g:i a, j F Y', -- 12hr time and date
mdy12 = 'g:i a, F j, Y',
dmy = 'H:i, j F Y', -- 24hr time and date
mdy = 'H:i, F j, Y',
iso = 'Y-m-d"T"H:i',
dow = 'l', -- day of the week
min = 'i', -- hour or minute only
h12 = 'g',
h24 = 'H',
}
--[[--------------------------< A L I A S E S >----------------------------------------------------------------