public static function DateRecurGranularityMap::granularityExpectedFormatMessages in Recurring Dates Field 8.2
Same name and namespace in other branches
- 3.x src/DateRecurGranularityMap.php \Drupal\date_recur\DateRecurGranularityMap::granularityExpectedFormatMessages()
- 3.0.x src/DateRecurGranularityMap.php \Drupal\date_recur\DateRecurGranularityMap::granularityExpectedFormatMessages()
- 3.1.x src/DateRecurGranularityMap.php \Drupal\date_recur\DateRecurGranularityMap::granularityExpectedFormatMessages()
Granularities and their associated failed validation message labels.
Parameters
string $sample: A sample string.
Return value
\Drupal\Core\StringTranslation\TranslatableMarkup[] Failed validation messages for granularities keyed by granularity.
1 call to DateRecurGranularityMap::granularityExpectedFormatMessages()
- DateRecurFilter::validateValue in src/
Plugin/ views/ filter/ DateRecurFilter.php - Form field validator.
File
- src/
DateRecurGranularityMap.php, line 70
Class
- DateRecurGranularityMap
- Granularity maps.
Namespace
Drupal\date_recurCode
public static function granularityExpectedFormatMessages(string $sample) : array {
return [
'year' => \t('YYYY (Year, for example: @sample)', [
'@sample' => $sample,
]),
'month' => \t('YYYY-MM (Year-month, for example: @sample)', [
'@sample' => $sample,
]),
'day' => \t('YYYY-MM-DD (Year-month-day, for example: @sample)', [
'@sample' => $sample,
]),
'second' => \t('YYYY-MM-DDTHH:MM:SS (for example: @sample)', [
'@sample' => $sample,
]),
];
}