public static function DateRecurUtility::createSmallestDateFromInput in Recurring Dates Field 8.2
Same name and namespace in other branches
- 3.x src/DateRecurUtility.php \Drupal\date_recur\DateRecurUtility::createSmallestDateFromInput()
- 3.0.x src/DateRecurUtility.php \Drupal\date_recur\DateRecurUtility::createSmallestDateFromInput()
- 3.1.x src/DateRecurUtility.php \Drupal\date_recur\DateRecurUtility::createSmallestDateFromInput()
Get the smallest date given a granularity and input.
Parameters
string $granularity: The granularity of the input.
string $value: User date input.
\DateTimeZone $timezone: The timezone of the input.
Return value
\DateTime A date time with the smallest value given granularity and input.
Throws
\InvalidArgumentException When date or granularity results in an invalid data object.
3 calls to DateRecurUtility::createSmallestDateFromInput()
- DateRecurFilter::validateExposed in src/
Plugin/ views/ filter/ DateRecurFilter.php - Validate the exposed handler form
- DateRecurFilter::validateValue in src/
Plugin/ views/ filter/ DateRecurFilter.php - Form field validator.
- DateRecurUtilityTest::testSmallestDate in tests/
src/ Kernel/ DateRecurUtilityTest.php - Tests smallest date utility.
File
- src/
DateRecurUtility.php, line 30
Class
- DateRecurUtility
- Provide standalone utilities.
Namespace
Drupal\date_recurCode
public static function createSmallestDateFromInput(string $granularity, string $value, \DateTimeZone $timezone) : \DateTime {
return static::createDateFromInput($granularity, $value, $timezone, 'start');
}