зеркало из https://github.com/mozilla/pjs.git
Bug 419510 PAC dateRange function doesn't handle months after JUN
r=biesi a=dsicore Also adds support for getDay("SAT")...
This commit is contained in:
Родитель
c4ad19759c
Коммит
a7bb4c6fc2
|
@ -243,15 +243,14 @@ var pacUtils =
|
|||
" return newRe.test(url);\n" +
|
||||
"}\n" +
|
||||
|
||||
"var wdays = new Array('SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT');\n" +
|
||||
"var wdays = {SUN: 0, MON: 1, TUE: 2, WED: 3, THU: 4, FRI: 5, SAT: 6};\n" +
|
||||
|
||||
"var monthes = new Array('JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC');\n"+
|
||||
"var months = {JAN: 0, FEB: 1, MAR: 2, APR: 3, MAY: 4, JUN: 5, JUL: 6, AUG: 7, SEP: 8, OCT: 9, NOV: 10, DEC: 11};\n"+
|
||||
|
||||
"function weekdayRange() {\n" +
|
||||
" function getDay(weekday) {\n" +
|
||||
" for (var i = 0; i < 6; i++) {\n" +
|
||||
" if (weekday == wdays[i]) \n" +
|
||||
" return i;\n" +
|
||||
" if (weekday in wdays) {\n" +
|
||||
" return wdays[weekday];\n" +
|
||||
" }\n" +
|
||||
" return -1;\n" +
|
||||
" }\n" +
|
||||
|
@ -274,9 +273,8 @@ var pacUtils =
|
|||
|
||||
"function dateRange() {\n" +
|
||||
" function getMonth(name) {\n" +
|
||||
" for (var i = 0; i < 6; i++) {\n" +
|
||||
" if (name == monthes[i])\n" +
|
||||
" return i;\n" +
|
||||
" if (name in months) {\n" +
|
||||
" return months[name];\n" +
|
||||
" }\n" +
|
||||
" return -1;\n" +
|
||||
" }\n" +
|
||||
|
|
Загрузка…
Ссылка в новой задаче