Sfoglia il codice sorgente

localized date range format

Bachir Soussi Chiadmi 6 anni fa
parent
commit
9ab88168f6

+ 6 - 0
sites/all/modules/figli/edlp_ajax/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatterAjax.php

@@ -55,8 +55,14 @@ class EntityReferenceLabelFormatterAjax extends EntityReferenceLabelFormatter {
   public function viewElements(FieldItemListInterface $items, $langcode) {
     $elements = [];
     $output_as_link = $this->getSetting('link');
+    $current_langcode = \Drupal::languageManager()->getCurrentLanguage()->getId();
 
     foreach ($this->getEntitiesToView($items, $langcode) as $delta => $entity) {
+
+      if ($entity->hasTranslation($current_langcode)) {
+        $entity = $entity->getTranslation($current_langcode);
+      }
+
       $label = $entity->label();
       // If the link is to be displayed and the entity has a uri, display a
       // link.

+ 3 - 3
sites/default/config/sync/core.entity_view_display.node.evenement.aside.yml

@@ -33,9 +33,9 @@ content:
       single: 'd F Y'
       single_all_day: 'd F Y'
       one_day: 'd F Y'
-      one_month: '\d\u d \a\u {d} F Y'
-      several_months: '\d\u d F \a\u {d} {F} Y'
-      several_years: '\d\u d F Y \a\u {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}'
       separator: '-'
       date_format: 'Y-m-d\TH:i:s'
     third_party_settings: {  }

+ 3 - 3
sites/default/config/sync/core.entity_view_display.node.evenement.default.yml

@@ -33,9 +33,9 @@ content:
       single: 'd F Y'
       single_all_day: 'd F Y'
       one_day: 'd F Y'
-      one_month: '\d\u d F \a\u {d} {F} Y'
-      several_months: '\d\u d F \a\u {d} {F} Y'
-      several_years: '\d\u d F Y \a\u {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}'
       separator: '-'
       date_format: 'Y-m-d\TH:i:s'
     third_party_settings: {  }

+ 3 - 3
sites/default/config/sync/core.entity_view_display.node.evenement.teaser.yml

@@ -36,9 +36,9 @@ content:
       single: 'd F Y'
       single_all_day: 'd F Y'
       one_day: 'd F Y'
-      one_month: '\d\u d \a\u {d} F Y'
-      several_months: '\d\u d F \a\u {d} {F} Y'
-      several_years: '\d\u d F Y \a\u {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}'
       separator: '-'
       date_format: 'Y-m-d\TH:i:s'
     third_party_settings: {  }

+ 3 - 3
sites/default/config/sync/system.performance.yml

@@ -1,8 +1,8 @@
 cache:
   page:
-    max_age: 86400
+    max_age: 0
 css:
-  preprocess: true
+  preprocess: false
   gzip: true
 fast_404:
   enabled: true
@@ -10,7 +10,7 @@ fast_404:
   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>'
 js:
-  preprocess: true
+  preprocess: false
   gzip: true
 stale_file_threshold: 2592000
 _core:

+ 8 - 4
sites/default/config/sync/views.view.content.yml

@@ -36,7 +36,7 @@ dependencies:
     - user.role.root
   module:
     - audiofield
-    - datetime_range
+    - date_range_formatter
     - image
     - node
     - options
@@ -4142,11 +4142,15 @@ display:
           empty_zero: false
           hide_alter_empty: true
           click_sort_column: value
-          type: daterange_default
+          type: date_range_without_time
           settings:
             timezone_override: ''
-            format_type: medium
-            separator: '-'
+            single: 'd F Y'
+            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_columns: {  }
           group_rows: true