ondrej390 - "buď pomocí JavaScriptu nebo PHP" - Nemel by spoledat na JS: new Date(), ale na datum serveru PHP: date('...',time()). Vypis pak samozrejme muze resit uz pres JS.
Lukáš Šašek - priklad do skoly?
<script>
function x(date)
{
//date = '31.8.2015 9:04';
//today = new Date(2015, 7, 31, 9, 4, 0); //m-1
var today;
date = (date+' 0 0 0').replace(/\D+/g,' ').split(' '); // pridat 3 nuly a mezery, kdyby nebyl zadan cas
today = new Date(date[2]*1, date[1]*1-1, date[0]*1, date[3]*1, date[4]*1, date[5]*1);
/*
alert([
today.getFullYear(),
today.getMonth(),
today.getDate(),
today.getHours(),
today.getMinutes(),
today.getSeconds()
]);
*/
return today;
}
var date1str, date1, date2, data, i,str,row;
date1str = '31.8.2015 9:04';
data = '\
11.6.2015 9:04;AAA\n\
11.7.2015 9:04;BBB\n\
31.8.2015 9:04;CCC\n\
11.9.2015 9:04;DDD\n\
11.10.2015 9:04;EEE\
'.split("\n");
date1 = x(date1str);
str = '';
for (i=0;i<data.length;++i)
{
row = data[i].split(';');
date2 = x(row[0]);
if (date2<date1)
{str+=row[0]+' - '+row[1];}
else
{str+='<label><input type="checkbox" name="ch'+i+'" value="'+row[0]+'">'+row[0]+' - '+row[1]+'<\/label>';}
str+='<br>';
}
document.write(str);
</script>