/**
* check the given date that was input by a user and convert it
* to proper gedcom date if possible
* @author John Finlay
* @param string $datestr the date input by the user
* @return string the converted date string
*/
function check_input_date($datestr)
{
    global $lang_short_cut, $LANGUAGE;
    // Convert from natural language to gedcom format
    $conversion_function = "edit_to_gedcom_date_{$lang_short_cut[$LANGUAGE]}";
    if (function_exists($conversion_function)) {
        $datestr = $conversion_function($datestr);
    } else {
        $datestr = default_edit_to_gedcom_date($datestr);
    }
    return trim($datestr);
}
Beispiel #2
0
function edit_to_gedcom_date_fi($datestr)
{
    // Allow "full finnish" dates to be converted to gedcom dates
    $datestr = preg_replace('/\\b(\\d{1,2})\\.? *( \\S+kuu)ta *( \\d{4})\\b/', '$1$2$3', $datestr);
    return default_edit_to_gedcom_date($datestr);
}