JS gevorderde |
|
dit zal waarschijnlijk werken: (als ik me niet vergis doet het Date object binnen js alles door rekenen, 30 of 31 dagen etc.)
var date_field = document.getElementById("veld1");
var date_field_2 = document.getElementById("veld2");
if (date_field.value.length <= 0) return;
var current_date = date_field.value.split(/\//i);
var new_date = new Date(current_date[0], current_date[1], current_date[2]);
date_field_2.value = new_date.getFullYear() + "/" + new_date.getMonth() + "/"+ new_date.getDate();
var date_field = document.getElementById("veld1"); var date_field_2 = document.getElementById("veld2"); if (date_field.value.length <= 0) return; var current_date = date_field.value.split(/\//i); var new_date = new Date(current_date[0], current_date[1], current_date[2]); date_field_2.value = new_date.getFullYear() + "/" + new_date.getMonth() + "/"+ new_date.getDate();
|