Example #1
0
/**
 * Overrides theme_date_display_single().
 */
function favrskovtheme_date_display_single($variables)
{
    if ($variables['dates']['format'] === 'l d. M Y G') {
        $day = $variables['dates']['value']['formatted_date'];
        $time = $variables['dates']['value']['formatted_time'];
        return t('!start-day / kl. !start-time', array('!start-day' => $day, '!start-time' => $time));
    }
    if ($variables['dates']['format'] === 'd M') {
        $day = t(date_format($variables['dates']['value']['db']['object'], 'd'));
        $month = t(date_format($variables['dates']['value']['db']['object'], 'M'));
        return '<time datetime="' . $variables['attributes']['content'] . '"><span class="day">' . $day . '</span><span class="month">' . $month . '</span></time>';
    }
    return theme_date_display_single($variables);
}
Example #2
0
/**
 * Implements hook_theme().
 */
function osha_frontend_date_display_single(&$variables)
{
    $date_theme = '';
    if (!empty($variables['dates']['value']['osha_date_theme'])) {
        $date_theme = $variables['dates']['value']['osha_date_theme'];
    }
    switch ($date_theme) {
        case 'calendar':
            return osha_frontend_date_calendar_icon($variables);
        default:
            return theme_date_display_single($variables);
    }
}