Skip to content

Instantly share code, notes, and snippets.

@Mark-H
Created February 10, 2012 17:44
Show Gist options
  • Save Mark-H/1791195 to your computer and use it in GitHub Desktop.
Save Mark-H/1791195 to your computer and use it in GitHub Desktop.
Prehook for Login.UpdateProfile for proper DOB support
<?php
$dob = $hook->getValue('dob');
if (!empty($dob)) {
$dob = strtotime($dob);
if (!$dob) {
$hook->setValue('dob',0);
} else {
$hook->setValue('dob',$dob);
}
} else {
$hook->setValue('dob',0);
}
return true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment