יחידה:Citation/CS1/Date validation: הבדלים בין גרסאות בדף
העתקה מהויקיפדיה האנגלית |
מ 3 גרסאות של הדף wikipedia:he:יחידה:Citation/CS1/Date_validation יובאו |
||
| (2 גרסאות ביניים של 2 משתמשים אינן מוצגות) | |||
| שורה 4: | שורה 4: | ||
-- returns a number according to the month in a date: 1 for January, etc. Capitalization and spelling must be correct. If not a valid month, returns 0 | -- returns a number according to the month in a date: 1 for January, etc. Capitalization and spelling must be correct. If not a valid month, returns 0 | ||
function get_month_number (month) | function get_month_number (month) | ||
local long_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}; | local long_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, ['ינואר']=1, ['פברואר']=2, ['מרץ']=3, ['אפריל']=4, ['מאי']=5, ['יוני']=6, ['יולי']=7, ['אוגוסט']=8, ['ספטמבר']=9, ['אוקטובר']=10, ['נובמבר']=11, ['דצמבר']=12, ['בינואר']=1, ['בפברואר']=2, ['במרץ']=3, ['באפריל']=4, ['במאי']=5, ['ביוני']=6, ['ביולי']=7, ['באוגוסט']=8, ['בספטמבר']=9, ['באוקטובר']=10, ['בנובמבר']=11, ['בדצמבר']=12}; | ||
local short_months = {['Jan']=1, ['Feb']=2, ['Mar']=3, ['Apr']=4, ['May']=5, ['Jun']=6, ['Jul']=7, ['Aug']=8, ['Sep']=9, ['Oct']=10, ['Nov']=11, ['Dec']=12}; | local short_months = {['Jan']=1, ['Feb']=2, ['Mar']=3, ['Apr']=4, ['May']=5, ['Jun']=6, ['Jul']=7, ['Aug']=8, ['Sep']=9, ['Oct']=10, ['Nov']=11, ['Dec']=12}; | ||
local temp; | local temp; | ||
| שורה 16: | שורה 16: | ||
-- returns a number according to the sequence of seasons in a year: 1 for Winter, etc. Capitalization and spelling must be correct. If not a valid season, returns 0 | -- returns a number according to the sequence of seasons in a year: 1 for Winter, etc. Capitalization and spelling must be correct. If not a valid season, returns 0 | ||
function get_season_number (season) | function get_season_number (season) | ||
local season_list = {['Winter']=1, ['Spring']=2, ['Summer']=3, ['Fall']=4, ['Autumn']=4} | local season_list = {['Winter']=1, ['Spring']=2, ['Summer']=3, ['Fall']=4, ['Autumn']=4, ['חורף']=1,['אביב']=2,['קיץ']=3,['סתיו']=4 } | ||
local temp; | local temp; | ||
temp=season_list[season]; | temp=season_list[season]; | ||