- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
var req_date = document.getElementById('requested_date').value.split('-');
if (req_date.length!=3 || new Number(req_date[0])<1990 || new Number(req_date[0])>2100
|| new Number(req_date[1])<1 || new Number(req_date[1])>12 || new Number(req_date[2])<1) {
alert('Requested date is not valid, please re-enter.');
return false;
}
var ef_date = document.getElementById('effective_date').value.split('-');
if (ef_date.length!=3 || new Number(ef_date[0])<1990 || new Number(ef_date[0])>2100
|| new Number(ef_date[1])<1 || new Number(ef_date[1])>12 || new Number(ef_date[2])<1) {
alert('Effective date is not valid, please re-enter.');
return false;
}
var ex_date = document.getElementById('expiration_date').value.split('-');
if (ex_date.length!=3 || new Number(ex_date[0])<1990 || new Number(ex_date[0])>2100
|| new Number(ex_date[1])<1 || new Number(ex_date[1])>12 || new Number(ex_date[2])<1) {
alert('Expiration date is not valid, please re-enter.');
return false;
}
var month_days = new Array(31,29,31,30,31,30,31,31,30,31,30,31);
if (new Number(req_date[0])%4) {
month_days[1] = 28;
}
if ((new Number(req_date[2])>month_days[new Number(req_date[1])-1]) ) {
alert('Requested date is not valid, please re-enter.');
return false;
}
if (new Number(ef_date[0])%4) {
month_days[1] = 28;
}
if ((new Number(ef_date[2])>month_days[new Number(ef_date[1])-1]) ) {
alert('Effective date is not valid, please re-enter.');
return false;
}
if (new Number(ex_date[0])%4) {
month_days[1] = 28;
}
if ((new Number(ex_date[2])>month_days[new Number(ex_date[1])-1]) ) {
alert('Expiration date is not valid, please re-enter.');
return false;
}
и такого там много.. еще на PHP скину
guest 24.11.2009 19:36 # +2
var RegExPattern = /^((((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$/;
return RegExPattern.test(someDate);
barop 23.01.2017 23:48 # 0
почему?
catosaur 23.01.2017 20:21 # 0
catosaur 23.01.2017 20:22 # 0
catosaur 23.01.2017 20:22 # 0
catosaur 23.01.2017 20:23 # 0
catosaur 23.01.2017 20:50 # 0
catosaur 23.01.2017 20:50 # 0
catosaur 23.01.2017 20:52 # 0
catosaur 23.01.2017 20:55 # 0
huesto 23.01.2017 21:39 # 0
inkanus-gray 23.01.2017 23:47 # +3
Это был бы номер.
Если б тестил бот меня,
Я б, наверно, помер.
guest8 09.04.2019 18:23 # −999
guest8 09.04.2019 18:24 # −999
guest8 09.04.2019 18:24 # −999
guest8 09.04.2019 18:24 # −999
guest8 09.04.2019 18:25 # −999
guest8 09.04.2019 18:26 # −999
guest8 09.04.2019 18:26 # −999
guest8 09.04.2019 18:26 # −999
guest8 09.04.2019 18:27 # −999
guest8 09.04.2019 18:27 # −999
guest8 09.04.2019 18:28 # −999
guest8 09.04.2019 18:29 # −999
guest8 09.04.2019 18:29 # −999
guest8 09.04.2019 18:29 # −999
guest8 09.04.2019 18:29 # −999
guest8 09.04.2019 18:30 # −999
guest8 09.04.2019 18:30 # −999