Module:Time/data/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
(48 intermediate revisions by 5 users not shown)
Line 1:
p = {}
 
--[[--------------------------< C O TN HF EI RG U R A T I M E Z O N E D A BT B R E VA >------------------------------------------
 
for internationalization, this section to hold constant text, parameter names and values, other items subject to
p.other_names = {
language translation
['et'] = {tz = 'est'},
['pt'] = {tz = 'pst'},
 
]]
---< E A S T O F U T C>---
 
local cfg = {
['bst'] = {tz = 'gmt'},
['default_df'] = 'mdy', -- default date format when |<df> and |df= omitted or empty
['ist'] = {tz = 'gmt'},
['westdf_vals'] = {tz = 'wet'},
['cestdmy'] = {tz = 'cst'}true,
['dmy12']=true, -- also 'y'
['eest'] = {tz = 'eet'},
['acdtdow'] = {tz = 'acst'}true,
['aedtmdy'] = {tz = 'aest'}true,
['nzdtmdy12'] = {tz = 'nzst'}true,
['iso']=true,
['y']=true, -- also 'dmy' and 'dmy12'
['12']=true,
['24']=true,
};
 
['err_msg'] = '<span style="font-size:100%" class="error">&#x7B;{$1}} – $2 ([[Template:$1#Error messages|help]])</span>',
---< W E S T O F U T C >---
['err_text'] = {
['bad_def'] = 'incomplete definition for $1',
['bad_df_pair'] = 'both of &#124;df-cust-a= and &#124;df-cust-p required',
['bad_dst'] = 'error calculating dst timestamps',
['bad_format'] = 'invalid date format $1',
['bad_sign'] = 'invalid use of ±',
['test_time'] = 'malformed or incomplete _TEST_TIME_',
['unknown_tz'] = 'unknown timezone $1',
['missing_tz'] = 'missing required timezone',
},
 
['format'] = { -- output formatting strings
['pmdt'] = {tz = 'pmst'},
['wgst'] t12 = {tz'g:i = 'wgta'}, -- time only
['ndt'] = {tz t24 = 'nstH:i'},
['adt'] = {tz = 'ast'},
iso_date ='Y-m-d', -- date only
['edt'] = {tz = 'est'},
['cdt'] dmy_date = {tz'j =F Y'cst'},
['mdt'] mdy_date = {tz'F =j, Y'mst'},
['pdt'] = {tz = 'pst'},
dmy12 = 'g:i a, j F Y', -- 12hr time and date
['akdt'] = {tz = 'akst'},
['hadt'] mdy12 = {tz'g:i =a, F j, Y'hast'},
};
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
},
 
['refresh-label'] = 'refresh',
--[[--------------------------< T I M E Z O N E P R O P E R T I E S >----------------------------------------
-- 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 list
When specifying utc offset do not use the minus character (U+2212) for offsets west of 0 meridian; use the minus-hyphen
aliases = {
['dateonly'] = {'dateonly'},
['df'] = {'df'},
['df-cust'] = {'df-cust'},
['df-cust-a'] = {'df-cust-a'},
['df-cust-p'] = {'df-cust-p'},
['dst'] = {'dst'},
['hide-refresh'] = {'hide-refresh'},
['hide-tz'] = {'hide-tz'},
['lang'] = {'lang'},
['timeonly'] = {'timeonly'},
['unlink-tz'] = {'unlink-tz'},
}
}
 
 
--[[--------------------------< A L I A S E S >----------------------------------------------------------------
 
]]
 
local tz_aliases = {
p.tz_data = { -- these are ordered by UTC offset +HH:MM followed by -HH:MM
['british summer time'] = 'gmt-uk',
['irish standard time'] = 'gmt-ie',
['usz1'] = 'kalt', -- old form Kaliningrad time
 
['west'] = 'wet', -- dst aliases east of utc
['cest'] = 'cet',
['eest'] = 'eet',
['acdt'] = 'acst',
['aedt'] = 'aest',
['nzdt'] = 'nzst',
 
['at'] = 'ast', -- alternate abbreviations west of utc
['et'] = 'est',
['ct'] = 'cst',
['pt'] = 'pst',
['akt'] = 'akst',
['hast'] = 'hst',
 
['pmdt'] = 'pmst', -- dst aliases west of utc
['wgst'] = 'wgt',
['ndt'] = 'nst',
['adt'] = 'ast',
['edt'] = 'est',
['cdt'] = 'cst',
['mdt'] = 'mst',
['pdt'] = 'pst',
['akdt'] = 'akst',
['hdt'] = 'hst',
['hadt'] = 'hst',
}
 
 
--[[--------------------------< T I M E Z O N E D A T A >----------------------------------------------------
 
When specifying utc offset do not use the minus character (U+2212) for offsets west of 0 meridian; use the minus-hyphen
 
]]
 
local tz_data = {
------------------------------< E A S T U T C + H H : M M >--------------------------------------------------
 
Line 114 ⟶ 192:
article = 'Eastern European Time'
},
['usz1ilst'] = {
abbr = 'USZ1IST',
dst_abbr = 'IDT',
utc_offset = '02:00',
df = 'dmy',
dst_begins = 'last Friday in March',
dst_ends = 'last Sunday in October',
dst_time = '02:00',
article = 'Time in Israel'
},
['kalt'] = {
abbr = 'KALT',
dst_abbr = '',
utc_offset = '02:00',
Line 123 ⟶ 211:
dst_time = '',
article = 'Kaliningrad Time'
},
['sast'] = {
abbr = 'SAST',
dst_abbr = '',
utc_offset = '02:00',
df = 'dmy',
dst_begins = '',
dst_ends = '',
dst_time = '',
dst_e_time = '',
article = 'South African Standard Time'
},
['msk'] = {
Line 133 ⟶ 232:
dst_time = '',
article = 'Moscow Time'
},
['irst'] = {
abbr = 'IRST',
dst_abbr = '',
utc_offset = '03:30',
df = 'dmy',
dst_begins = '',
dst_ends = '',
dst_time = '',
article = 'Iran Standard Time'
},
['samt'] = {
Line 144 ⟶ 253:
article = 'Samara Time'
},
['yektkzt'] = {
abbr = 'YEKTKZT',
dst_abbr = '',
utc_offset = '05:00',
Line 152 ⟶ 261:
dst_ends = '',
dst_time = '',
dst_e_time = '',
article = 'Yekaterinburg Time'
article = 'Time in Kazakhstan'
},
['mvt'] = {
abbr = 'MVT',
dst_abbr = '',
utc_offset = '05:00',
df = 'dmy',
dst_begins = '',
dst_ends = '',
dst_time = '',
article = 'Time in Maldives'
},
['pkt'] = {
Line 163 ⟶ 283:
dst_time = '',
article = 'Pakistan Standard Time'
},
['yekt'] = {
abbr = 'YEKT',
dst_abbr = '',
utc_offset = '05:00',
df = 'dmy',
dst_begins = '',
dst_ends = '',
dst_time = '',
article = 'Yekaterinburg Time'
},
['ist'] = {
Line 210 ⟶ 340:
dst_time = '',
article = 'Omsk Time'
},
['mmt'] = {
abbr = 'MMT',
dst_abbr = '',
utc_offset = '06:30',
df = 'dmy',
dst_begins = '',
dst_ends = '',
dst_time = '',
article = 'Myanmar Standard Time'
},
['krat'] = {
Line 260 ⟶ 400:
dst_time = '',
article = 'Irkutsk Time'
},
['myt'] = {
abbr = 'MYT',
dst_abbr = '',
utc_offset = '08:00',
df = 'dmy',
dst_begins = '',
dst_ends = '',
dst_time = '',
article = 'Time in Malaysia'
},
['pht'] = {
abbr = 'PHT',
dst_abbr = '',
utc_offset = '08:00',
df = 'mdy',
dst_begins = '',
dst_ends = '',
dst_time = '',
article = 'Philippine Standard Time',
},
['sst'] = {
Line 290 ⟶ 450:
dst_time = '',
article = 'Japan Standard Time'
},
['kpt'] = {
abbr = 'PYT',
dst_abbr = '',
utc_offset = '09:00',
df = 'dmy',
dst_begins = '',
dst_ends = '',
dst_time = '',
article = 'Time in North Korea'
},
['kst'] = {
Line 363 ⟶ 533:
dst_time = '',
article = 'Vladivostok Time'
},
['magt'] = {
abbr = 'MAGT',
dst_abbr = '',
utc_offset = '11:00',
df = 'dmy',
dst_begins = '',
dst_ends = '',
dst_time = '',
article = 'Magadan Time'
},
['sret'] = {
Line 409 ⟶ 589:
------------------------------< W E S T U T C - H H : M M >--------------------------------------------------
 
['gft'] = {
abbr = 'GFT',
dst_abbr = '',
utc_offset = '-03:00',
df = 'dmy',
dst_begins = '',
dst_ends = '',
dst_time = '',
article = 'French Guiana Time'
},
['pmst'] = {
abbr = 'PMST',
Line 499 ⟶ 689:
article = 'Alaska Time Zone'
},
['hasthst'] = { -- same as AleutST and HSTHAST
abbr = 'HASTHST',
dst_abbr = 'HADTHDT',
utc_offset = '-10:00',
df = 'mdy',
Line 582 ⟶ 772:
 
 
--[[--------------------------< E X P O R T E D T A B L E S >------------------------------------------------
return p;
]]
 
return {
cfg = cfg,
tz_aliases = tz_aliases,
tz_data = tz_data,
}