function opigno_calendar_generate_entry in Opigno calendar 3.x
Same name and namespace in other branches
- 8 opigno_calendar.module \opigno_calendar_generate_entry()
Build day date box.
1 call to opigno_calendar_generate_entry()
File
- ./
opigno_calendar.module, line 106 - Contains opigno_calendar.module.
Code
function opigno_calendar_generate_entry($variables, $content, $attached) {
$date = new DateTimePlus($variables['item']['date']);
return [
'#attached' => $attached,
'date_box' => [
'#theme_wrappers' => [
'container',
],
'#attributes' => [
'class' => [
'date-box',
],
],
'content' => [
'day' => [
'#type' => 'html_tag',
'#tag' => 'span',
'#attributes' => [
'class' => [
'date-day',
],
],
'#value' => $date
->format('d'),
],
'month' => [
'#type' => 'html_tag',
'#tag' => 'span',
'#attributes' => [
'class' => [
'date-month',
],
],
'#value' => t($date
->format('F')),
],
'year' => [
'#type' => 'html_tag',
'#tag' => 'span',
'#attributes' => [
'class' => [
'date-year',
],
],
'#value' => $date
->format('Y'),
],
],
],
'items' => [
'#theme_wrappers' => [
'container',
],
'#attributes' => [
'class' => [
'items',
],
],
'content' => $content,
],
];
}