Module:Time/data/sandbox: Difference between revisions

Content deleted Content added
No edit summary
synch from live;
Line 8:
 
local cfg = {
---- default date format ----
['default_df'] = 'mdy', -- default date format when |<df> and |df= omitted or empty
['df_vals'] = {
['dmy']=true, ['dmy12']=true, -- also 'y'
['dow']=true,
['mdy']=true, ['mdy12']=true,
['iso']=true,
min = ['iy']=true, -- houralso or'dmy' minuteand only'dmy12'
['ymd']=false, -- not permitted at en.wiki per [[MOS:DATESNO]] - not currently supported
['12']=true, ['24']=true,
};
 
---- error messages ----
['err_msg'] = '<span style="font-size:100%" class="error">{{time}} – $1 ([[Template:Time#Error messages|help]])</span>',
['err_text'] = {
Line 21 ⟶ 25:
['bad_format'] = 'invalid date format $1',
['bad_sign'] = 'invalid use of ±',
['test_time'] = 'malformed or incomplete test time_TEST_TIME_',
['unknown_tz'] = 'unknown timezone $1',
},
 
formats['format'] = { -- output formatting strings
---- formats table ----
formats = { -- output formatting strings
t12 = 'g:i a', -- time only
t24 = 'H:i',
Line 34 ⟶ 36:
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
Line 43 ⟶ 45:
iso = 'Y-m-d"T"H:i',
dow = 'l', -- day of the week
},
 
min = 'i', -- hour or minute only
-- -- for dst calculations ----
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 and parameter aliases table ----list
aliases = {
['df'] = {'df','format'},
['dst'] = {'dst','ds'},
['dateonly'] = {'dateonly' , 'do', 'date', 'notime'},
['timeonly'] = {'timeonly' , 'to', 'time', 'nodate'},
['hide-refresh'] = {'hide-refresh', 'no-refresh'},
['hide-tz'] = {'hide-tz', 'no-tz', 'hide-timezone', 'verbergen-tz'},
['unlink-tz'] = {'unlink-tz','unlink','nolink'},
}
}
 
}
 
--[[--------------------------< A L I A S E S >----------------------------------------------------------------
Line 77 ⟶ 75:
['irish standard time'] = 'gmt-ie',
['usz1'] = 'kalt', -- old form Kaliningrad time
['at'] = 'ast', -- alternate abbreviations west of utc
['et'] = 'est',
['ct'] = 'cst',
['pt'] = 'pst',
['akt'] = 'akst',
['hst'] = 'hast',
}
--[[--------------------------< D S T T I M E Z O N E S >------------------------------------------------------
 
]]
 
local dst_tz = {
 
['west'] = 'wet', -- dst aliases east of utc
Line 98 ⟶ 82:
['aedt'] = 'aest',
['nzdt'] = 'nzst',
 
['at'] = 'ast', -- alternate abbreviations west of utc
['et'] = 'est',
['ct'] = 'cst',
['pt'] = 'pst',
['akt'] = 'akst',
['hst'] = 'hast',
 
['pmdt'] = 'pmst', -- dst aliases west of utc
Line 109 ⟶ 100:
['akdt'] = 'akst',
['hdt'] = 'hast',
}
 
 
Line 666 ⟶ 657:
cfg = cfg,
tz_aliases = tz_aliases,
dst_tz = dst_tz,
tz_data = tz_data,
}