52
52
if (!empty($prev_date) && !empty($vars['prev_url']) && date_format($prev_date, 'Y') < $view->date_info->min_allowed_year) {
53
53
$vars['prev_url'] = '';
56
$vars['prev_options'] += array('attributes' => array());
57
$vars['next_options'] += array('attributes' => array());
61
// Build next/prev link titles.
62
switch($view->date_info->granularity) {
64
$prev_title = t('Navigate to previous year');
65
$next_title = t('Navigate to next year');
68
$prev_title = t('Navigate to previous month');
69
$next_title = t('Navigate to next month');
72
$prev_title = t('Navigate to previous week');
73
$next_title = t('Navigate to next week');
76
$prev_title = t('Navigate to previous day');
77
$next_title = t('Navigate to next day');
80
$vars['prev_options']['attributes'] += array('title' => $prev_title);
81
$vars['next_options']['attributes'] += array('title' => $next_title);
56
$vars['prev_options'] += array('attributes' => array('rel' => 'nofollow'));
57
$vars['next_options'] += array('attributes' => array('rel' => 'nofollow'));
83
// Add nofollow for next/prev links.
84
$vars['prev_options']['attributes'] += array('rel' => 'nofollow');
85
$vars['next_options']['attributes'] += array('rel' => 'nofollow');
60
88
// Month navigation titles are used as links in the block view.
94
122
// TODO Update this.
95
123
if (!empty($view->date_info->mini) || $link) {
96
124
// Month navigation titles are used as links in the mini view.
97
return l($title, $view->date_info->url);
125
$attributes = array('title' => t('View full page month'));
126
return l($title, $view->date_info->url, array('attributes' => $attributes));
326
355
function theme_date_part_label_timezone($part_type, $element) {
327
356
return t('Timezone');
360
* Theme for a date block that looks like a mini calendar day.
361
* Pass in a date object already set to the right timezone,
362
* format as a calendar page date. The calendar styling is created in css.
364
function theme_date_calendar_day($date) {
368
return '<div class="date-calendar-day">' .
369
'<span class="month">' . date_format_date($date, 'custom', 'M') . '</span>' .
370
'<span class="day">' . date_format_date($date, 'custom', 'j') . '</span>' .
371
'<span class="year">' . date_format_date($date, 'custom', 'Y') . '</span>' .
375
function theme_date_time_ago($start_date, $end_date, $interval = 2) {
376
// If no date is sent, then return nothing
377
if (empty($start_date) || empty($end_date)){
381
// Time to compare dates to
382
$now = date_format(date_now(), DATE_FORMAT_DATETIME);
383
$start = date_format($start_date, DATE_FORMAT_DATETIME);
384
$end = date_format($end_date, DATE_FORMAT_DATETIME);
386
// 1) The date is entirely in the future
388
return t('!time from now', array('!time' => date_format_interval($start_date, $interval)));
391
elseif ($now > $start && $now <= $end) {
392
//return t('Started !time ago', array('!time' => $dates['value']['interval']));
395
// 3) Date is in the past (format_interval added 'ago' to the value).
397
return date_format_interval($start_date, $interval);
b'\\ No newline at end of file'