get_the_ID()
is a “Loop” function. It won’t outside the Loop, and there is not Loop in your code. Essentially, you are passing a bad ID
to the function causing it to fail. If you had debugging enabled you might see feedback to that effect.
You are also using a variable– $dateStart
— that is not set in the context of the function.
You are not properly using the save_post
hook, however. WordPress will pass the post ID through to your callback if you ask for it.
Finally, what you want is global $_POST;
which is the PHP form data, and not global $post;
with is a WordPress variable that is a primary component of Loops.
function cpt_event_save_data($pid) {
global $_POST;
$dateStart = $_POST['date-start'];
// sanitize $datestart, maybe with PHP's checkdate()
// I don't know what the format of your string is though
update_post_meta($pid, "date-start", $dateStart);
}
Untested, but that should be pretty close.