本文整理汇总了PHP中Contao\Date::getNumericDatimFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP Date::getNumericDatimFormat方法的具体用法?PHP Date::getNumericDatimFormat怎么用?PHP Date::getNumericDatimFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contao\Date
的用法示例。
在下文中一共展示了Date::getNumericDatimFormat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNumericDateTimeInterval
public static function getNumericDateTimeInterval($intStart = null, $intEnd = null, $strIntervalDelimiter = ' – ', $strDelimiter = ', ')
{
if (date(\Contao\Date::getNumericDateFormat(), $intStart) == date(\Contao\Date::getNumericDateFormat(), $intEnd)) {
return static::getNumericDateInterval($intStart, $intEnd, $strIntervalDelimiter) . $strDelimiter . static::getNumericTimeInterval($intStart, $intEnd, $strIntervalDelimiter);
} else {
return static::getDateTimeInterval(\Contao\Date::getNumericDatimFormat(), $intStart, $intEnd, $strIntervalDelimiter);
}
}
示例2: validator
//.........这里部分代码省略.........
break;
// Do not allow any characters that are usually encoded by class Input ([#<>()\=])
// Do not allow any characters that are usually encoded by class Input ([#<>()\=])
case 'extnd':
if (!\Validator::isExtendedAlphanumeric(html_entity_decode($varInput))) {
$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['extnd'], $this->strLabel));
}
break;
// Check whether the current value is a valid date format
// Check whether the current value is a valid date format
case 'date':
if (!\Validator::isDate($varInput)) {
$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['date'], \Date::getInputFormat(\Date::getNumericDateFormat())));
} else {
// Validate the date (see #5086)
try {
new \Date($varInput, \Date::getNumericDateFormat());
} catch (\OutOfBoundsException $e) {
$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['invalidDate'], $varInput));
}
}
break;
// Check whether the current value is a valid time format
// Check whether the current value is a valid time format
case 'time':
if (!\Validator::isTime($varInput)) {
$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['time'], \Date::getInputFormat(\Date::getNumericTimeFormat())));
}
break;
// Check whether the current value is a valid date and time format
// Check whether the current value is a valid date and time format
case 'datim':
if (!\Validator::isDatim($varInput)) {
$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['dateTime'], \Date::getInputFormat(\Date::getNumericDatimFormat())));
} else {
// Validate the date (see #5086)
try {
new \Date($varInput, \Date::getNumericDatimFormat());
} catch (\OutOfBoundsException $e) {
$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['invalidDate'], $varInput));
}
}
break;
// Check whether the current value is a valid friendly name e-mail address
// Check whether the current value is a valid friendly name e-mail address
case 'friendly':
list($strName, $varInput) = \StringUtil::splitFriendlyEmail($varInput);
// no break;
// Check whether the current value is a valid e-mail address
// no break;
// Check whether the current value is a valid e-mail address
case 'email':
if (!\Validator::isEmail($varInput)) {
$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['email'], $this->strLabel));
}
if ($this->rgxp == 'friendly' && !empty($strName)) {
$varInput = $strName . ' [' . $varInput . ']';
}
break;
// Check whether the current value is list of valid e-mail addresses
// Check whether the current value is list of valid e-mail addresses
case 'emails':
$arrEmails = \StringUtil::trimsplit(',', $varInput);
foreach ($arrEmails as $strEmail) {
$strEmail = \Idna::encodeEmail($strEmail);
if (!\Validator::isEmail($strEmail)) {