Issue #3172582 by pameeela, g-brodiei, sarvjeetsingh, mstrelan, quietone, alexpott, larowlan, MrPaulDriver: Update PHP manual link for date/time formatting help
parent
989f135f66
commit
ad3f34c127
|
@ -120,7 +120,7 @@ class TimestampFormatter extends FormatterBase {
|
|||
$elements['custom_date_format'] = [
|
||||
'#type' => 'textfield',
|
||||
'#title' => $this->t('Custom date format'),
|
||||
'#description' => $this->t('See <a href="http://php.net/manual/function.date.php" target="_blank">the documentation for PHP date formats</a>.'),
|
||||
'#description' => $this->t('See <a href="https://www.php.net/manual/datetime.format.php#refsect1-datetime.format-parameters" target="_blank">the documentation for PHP date formats</a>.'),
|
||||
'#default_value' => $this->getSetting('custom_date_format') ?: '',
|
||||
];
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class DateFormat extends FormElementBase {
|
|||
public function getTranslationElement(LanguageInterface $translation_language, $source_config, $translation_config) {
|
||||
/** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */
|
||||
$date_formatter = \Drupal::service('date.formatter');
|
||||
$description = $this->t('A user-defined date format. See the <a href="http://php.net/manual/function.date.php">PHP manual</a> for available options.');
|
||||
$description = $this->t('A user-defined date format. See the <a href="https://www.php.net/manual/datetime.format.php#refsect1-datetime.format-parameters">PHP manual</a> for available options.');
|
||||
$format = $this->t('Displayed as %date_format', ['%date_format' => $date_formatter->format(REQUEST_TIME, 'custom', $translation_config)]);
|
||||
|
||||
return [
|
||||
|
|
|
@ -68,7 +68,7 @@ class DateTimeCustomFormatter extends DateTimeFormatterBase {
|
|||
$form['date_format'] = [
|
||||
'#type' => 'textfield',
|
||||
'#title' => $this->t('Date/time format'),
|
||||
'#description' => $this->t('See <a href="http://php.net/manual/function.date.php" target="_blank">the documentation for PHP date formats</a>.'),
|
||||
'#description' => $this->t('See <a href="https://www.php.net/manual/datetime.format.php#refsect1-datetime.format-parameters" target="_blank">the documentation for PHP date formats</a>.'),
|
||||
'#default_value' => $this->getSetting('date_format'),
|
||||
];
|
||||
|
||||
|
|
|
@ -24,4 +24,4 @@ related:
|
|||
<li>{% trans %}Repeat the previous three steps for any other date formats that need to be changed.{% endtrans %}</li>
|
||||
</ol>
|
||||
<h2>{% trans %}Additional resources{% endtrans %}</h2>
|
||||
<p>{% trans %}<a href="https://php.net/manual/function.date.php">PHP date format codes reference</a>{% endtrans %}</p>
|
||||
<p>{% trans %}<a href="https://www.php.net/manual/datetime.format.php#refsect1-datetime.format-parameters">PHP date format codes reference</a>{% endtrans %}</p>
|
||||
|
|
|
@ -96,7 +96,7 @@ abstract class DateFormatFormBase extends EntityForm {
|
|||
'#type' => 'textfield',
|
||||
'#title' => t('Format string'),
|
||||
'#maxlength' => 100,
|
||||
'#description' => $this->t('A user-defined date format. See the <a href="http://php.net/manual/function.date.php">PHP manual</a> for available options.'),
|
||||
'#description' => $this->t('A user-defined date format. See the <a href="https://www.php.net/manual/datetime.format.php#refsect1-datetime.format-parameters">PHP manual</a> for available options.'),
|
||||
'#required' => TRUE,
|
||||
'#attributes' => [
|
||||
'data-drupal-date-formatter' => 'source',
|
||||
|
|
|
@ -68,7 +68,7 @@ function system_token_info() {
|
|||
];
|
||||
$date['custom'] = [
|
||||
'name' => t("Custom format"),
|
||||
'description' => t('A date in a custom format. See <a href="http://php.net/manual/function.date.php">the PHP documentation</a> for details.'),
|
||||
'description' => t('A date in a custom format. See <a href="https://www.php.net/manual/datetime.format.php#refsect1-datetime.format-parameters">the PHP documentation</a> for details.'),
|
||||
];
|
||||
$date['since'] = [
|
||||
'name' => t("Time-since"),
|
||||
|
|
|
@ -106,7 +106,7 @@ class Date extends FieldPluginBase {
|
|||
$form['custom_date_format'] = [
|
||||
'#type' => 'textfield',
|
||||
'#title' => $this->t('Custom date format'),
|
||||
'#description' => $this->t('If "Custom", see <a href="http://us.php.net/manual/en/function.date.php" target="_blank">the PHP docs</a> for date formats. Otherwise, enter the number of different time units to display, which defaults to 2.'),
|
||||
'#description' => $this->t('If "Custom", see <a href="https://www.php.net/manual/datetime.format.php#refsect1-datetime.format-parameters" target="_blank">the PHP docs</a> for date formats. Otherwise, enter the number of different time units to display, which defaults to 2.'),
|
||||
'#default_value' => isset($this->options['custom_date_format']) ? $this->options['custom_date_format'] : '',
|
||||
];
|
||||
// Setup #states for all possible date_formats on the custom_date_format form element.
|
||||
|
|
Loading…
Reference in New Issue