1 2 3 4 5 6 7 8 9 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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| setDATE('date');
function setDATE(date){
tabMtoD = {"21/04/2011":"21/04/2011","31/07/2011":"31/07/2011","13/10/2011":"13/10/2011","22/12/2011":"22/12/2011"};
tabJtoM = {"31/07/2011":"31/07/2011","12/10/2011":"12/10/2011","22/12/2011":"22/12/2011","14/04/2012":"14/04/2012"};
tabOtoJ = {"13/10/2011":"13/10/2011","22/12/2011":"22/12/2011","15/04/2012":"15/04/2012","17/07/2012":"17/07/2012"};
tabDtoO = {"23/12/2011":"23/12/2011","18/04/2012":"18/04/2012","13/07/2012":"13/07/2012","17/10/2012":"17/10/2012"};
tabM012toD = {"18/04/2012":"18/04/2012","19/07/2012":"19/07/2012","30/10/2012":"30/10/2012","10/12/2012":"10/12/2012"};
var actualDate= new Date();
if (actualDate.getDate() < '20' && (actualDate.getMonth()+1) < '04' && actualDate.getYear() == '2011'){
//Set Date in the dropdown list
jQuery.each(tabMtoD , function (value, text) {jQuery('#' + date).append(jQuery('<option></option').val(value).html(text));});
}
if (actualDate.getDate() >= '20' && (actualDate.getMonth()+1) >= '03' && (actualDate.getMonth()+1) < '07' && actualDate.getYear() == '2011'){
//Set Date in the dropdown list
jQuery.each(tabJtoM , function (value, text) {jQuery('#' + date).append(jQuery('<option></option').val(value).html(text));});
}
if (actualDate.getDate() < '20' && (actualDate.getMonth()+1) > '03' && (actualDate.getMonth()+1) < '07' && actualDate.getYear() == '2011'){
//Set Date in the dropdown list
jQuery.each(tabJtoM , function (value, text) {jQuery('#' + date).append(jQuery('<option></option').val(value).html(text));});
}
if (actualDate.getDate() >= '20' && (actualDate.getMonth()+1) >= '06' && (actualDate.getMonth()+1) < '10' && actualDate.getYear() == '2011'){
//Set Date in the dropdown list
jQuery.each(tabOtoJ , function (value, text) {jQuery('#' + date).append(jQuery('<option></option').val(value).html(text));});
}
if (actualDate.getDate() < '20' && (actualDate.getMonth()+1) > '06' && (actualDate.getMonth()+1) < '10' && actualDate.getYear() == '2011'){
//Set Date in the dropdown list
jQuery.each(tabOtoJ , function (value, text) {jQuery('#' + date).append(jQuery('<option></option').val(value).html(text));});
}
if (actualDate.getDate() >= '20' && (actualDate.getMonth()+1) >= '09' && (actualDate.getMonth()+1) < '12' && actualDate.getYear() == '2011'){
//Set Date in the dropdown list
jQuery.each(tabDtoO , function (value, text) {jQuery('#' + date).append(jQuery('<option></option').val(value).html(text));});
}
if (actualDate.getDate() < '20' && (actualDate.getMonth()+1) > '09' && (actualDate.getMonth()+1) < '12' && actualDate.getYear() == '2011'){
//Set Date in the dropdown list
jQuery.each(tabDtoO , function (value, text) {jQuery('#' + date).append(jQuery('<option></option').val(value).html(text));});
}
if (actualDate.getDate() < '20' && (actualDate.getMonth()+1) >= '01' && (actualDate.getMonth()+1) < '04' && actualDate.getYear() == '2012'){
//Set Date in the dropdown list
jQuery.each(tabM012toD , function (value, text) {jQuery('#' + date).append(jQuery('<option></option').val(value).html(text));});
}
} |
Partager