localized date range format
This commit is contained in:
+6
@@ -55,8 +55,14 @@ class EntityReferenceLabelFormatterAjax extends EntityReferenceLabelFormatter {
|
|||||||
public function viewElements(FieldItemListInterface $items, $langcode) {
|
public function viewElements(FieldItemListInterface $items, $langcode) {
|
||||||
$elements = [];
|
$elements = [];
|
||||||
$output_as_link = $this->getSetting('link');
|
$output_as_link = $this->getSetting('link');
|
||||||
|
$current_langcode = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||||
|
|
||||||
foreach ($this->getEntitiesToView($items, $langcode) as $delta => $entity) {
|
foreach ($this->getEntitiesToView($items, $langcode) as $delta => $entity) {
|
||||||
|
|
||||||
|
if ($entity->hasTranslation($current_langcode)) {
|
||||||
|
$entity = $entity->getTranslation($current_langcode);
|
||||||
|
}
|
||||||
|
|
||||||
$label = $entity->label();
|
$label = $entity->label();
|
||||||
// If the link is to be displayed and the entity has a uri, display a
|
// If the link is to be displayed and the entity has a uri, display a
|
||||||
// link.
|
// link.
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ content:
|
|||||||
single: 'd F Y'
|
single: 'd F Y'
|
||||||
single_all_day: 'd F Y'
|
single_all_day: 'd F Y'
|
||||||
one_day: 'd F Y'
|
one_day: 'd F Y'
|
||||||
one_month: '\d\u d \a\u {d} F Y'
|
one_month: 'F d \t\o {d}, Y'
|
||||||
several_months: '\d\u d F \a\u {d} {F} Y'
|
several_months: '\f\r\o\m F d \t\o {F} {d}, Y'
|
||||||
several_years: '\d\u d F Y \a\u {d} {F} {Y}'
|
several_years: '\f\r\o\m F d Y \t\o {F} {d} {Y}'
|
||||||
separator: '-'
|
separator: '-'
|
||||||
date_format: 'Y-m-d\TH:i:s'
|
date_format: 'Y-m-d\TH:i:s'
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ content:
|
|||||||
single: 'd F Y'
|
single: 'd F Y'
|
||||||
single_all_day: 'd F Y'
|
single_all_day: 'd F Y'
|
||||||
one_day: 'd F Y'
|
one_day: 'd F Y'
|
||||||
one_month: '\d\u d F \a\u {d} {F} Y'
|
one_month: 'F d \t\o {d}, Y'
|
||||||
several_months: '\d\u d F \a\u {d} {F} Y'
|
several_months: '\f\r\o\m F d \t\o {F} {d}, Y'
|
||||||
several_years: '\d\u d F Y \a\u {d} {F} {Y}'
|
several_years: '\f\r\o\m F d Y \t\o {F} {d} {Y}'
|
||||||
separator: '-'
|
separator: '-'
|
||||||
date_format: 'Y-m-d\TH:i:s'
|
date_format: 'Y-m-d\TH:i:s'
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ content:
|
|||||||
single: 'd F Y'
|
single: 'd F Y'
|
||||||
single_all_day: 'd F Y'
|
single_all_day: 'd F Y'
|
||||||
one_day: 'd F Y'
|
one_day: 'd F Y'
|
||||||
one_month: '\d\u d \a\u {d} F Y'
|
one_month: 'F d \t\o {d}, Y'
|
||||||
several_months: '\d\u d F \a\u {d} {F} Y'
|
several_months: '\f\r\o\m F d \t\o {F} {d}, Y'
|
||||||
several_years: '\d\u d F Y \a\u {d} {F} {Y}'
|
several_years: '\f\r\o\m F d Y \t\o {F} {d} {Y}'
|
||||||
separator: '-'
|
separator: '-'
|
||||||
date_format: 'Y-m-d\TH:i:s'
|
date_format: 'Y-m-d\TH:i:s'
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
cache:
|
cache:
|
||||||
page:
|
page:
|
||||||
max_age: 86400
|
max_age: 0
|
||||||
css:
|
css:
|
||||||
preprocess: true
|
preprocess: false
|
||||||
gzip: true
|
gzip: true
|
||||||
fast_404:
|
fast_404:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -10,7 +10,7 @@ fast_404:
|
|||||||
exclude_paths: '/\/(?:styles|imagecache)\//'
|
exclude_paths: '/\/(?:styles|imagecache)\//'
|
||||||
html: '<!DOCTYPE html><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>'
|
html: '<!DOCTYPE html><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>'
|
||||||
js:
|
js:
|
||||||
preprocess: true
|
preprocess: false
|
||||||
gzip: true
|
gzip: true
|
||||||
stale_file_threshold: 2592000
|
stale_file_threshold: 2592000
|
||||||
_core:
|
_core:
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ dependencies:
|
|||||||
- user.role.root
|
- user.role.root
|
||||||
module:
|
module:
|
||||||
- audiofield
|
- audiofield
|
||||||
- datetime_range
|
- date_range_formatter
|
||||||
- image
|
- image
|
||||||
- node
|
- node
|
||||||
- options
|
- options
|
||||||
@@ -4142,11 +4142,15 @@ display:
|
|||||||
empty_zero: false
|
empty_zero: false
|
||||||
hide_alter_empty: true
|
hide_alter_empty: true
|
||||||
click_sort_column: value
|
click_sort_column: value
|
||||||
type: daterange_default
|
type: date_range_without_time
|
||||||
settings:
|
settings:
|
||||||
timezone_override: ''
|
timezone_override: ''
|
||||||
format_type: medium
|
single: 'd F Y'
|
||||||
separator: '-'
|
single_all_day: 'd F Y'
|
||||||
|
one_day: 'd F Y'
|
||||||
|
one_month: 'F d \t\o {d}, Y'
|
||||||
|
several_months: '\f\r\o\m F d \t\o {F} {d}, Y'
|
||||||
|
several_years: '\f\r\o\m F d Y \t\o {F} {d} {Y}'
|
||||||
group_column: value
|
group_column: value
|
||||||
group_columns: { }
|
group_columns: { }
|
||||||
group_rows: true
|
group_rows: true
|
||||||
|
|||||||
Reference in New Issue
Block a user