Skip to content
Snippets Groups Projects

Issue #2689045 by aluzzardi, anas_maw, logickal, relaxnow, jigarius:

1 file
+ 4
0
Compare changes
  • Side-by-side
  • Inline
+ 4
0
@@ -91,6 +91,7 @@ function read_time_form_node_type_form_alter(&$form, FormStateInterface $form_st
@@ -91,6 +91,7 @@ function read_time_form_node_type_form_alter(&$form, FormStateInterface $form_st
'hour_long' => t('Hours & minutes, long (1 hour, 5 minutes)'),
'hour_long' => t('Hours & minutes, long (1 hour, 5 minutes)'),
'min_short' => t('Minutes, short (65 mins)'),
'min_short' => t('Minutes, short (65 mins)'),
'min_long' => t('Minutes, long (65 minutes)'),
'min_long' => t('Minutes, long (65 minutes)'),
 
'min_only' => t('Minutes only (65)'),
],
],
'#default_value' => $type->getThirdPartySetting('read_time', 'read_time_format', $defaults['format']),
'#default_value' => $type->getThirdPartySetting('read_time', 'read_time_format', $defaults['format']),
'#states' => [
'#states' => [
@@ -202,6 +203,9 @@ function read_time_node_view(array &$build, EntityInterface $entity, EntityViewD
@@ -202,6 +203,9 @@ function read_time_node_view(array &$build, EntityInterface $entity, EntityViewD
$hour_format = \Drupal::translation()->formatPlural($hours, '1 ' . $hour_suffix, '@count ' . $hour_suffix . 's');
$hour_format = \Drupal::translation()->formatPlural($hours, '1 ' . $hour_suffix, '@count ' . $hour_suffix . 's');
$read_time = new FormattableMarkup('@h, @m', ['@h' => $hour_format, '@m' => $minute_format]);
$read_time = new FormattableMarkup('@h, @m', ['@h' => $hour_format, '@m' => $minute_format]);
}
}
 
elseif ($format == 'min_only') {
 
$read_time = $minutes;
 
}
else {
else {
$read_time = $minute_format;
$read_time = $minute_format;
}
}
Loading