Lines Matching refs:date
9 * Format a date
14 public const CANONICAL = "variable:date";
16 public const DATE_ATTRIBUTE = "date";
17 public const TAG = "date";
25 * @param string $date
31 public static function formatDateString(string $date, string $format = DateTag::DEFAULT_FORMAT, string $lang = null): string
33 // https://www.php.net/manual/en/function.date.php
34 // To format dates in other languages, you should use the setlocale() and strftime() functions instead of date().
66 // throw new ExceptionBadSyntax("The language ($lang) / locale ($derivedLocale) is not available as locale on the server. You can't then format the value ($date) in this language.");
70 $date = syntax_plugin_combo_variable::replaceVariablesWithValuesFromContext($date);
71 $timeStamp = Iso8601Date::createFromString($date)->getDateTime()->getTimestamp();
77 throw new ExceptionBadSyntax("Unable to format the date ($date) with the format ($format) and lang ($lang)");
91 LogUtility::warning("The date component has been deprecated for the date variable", DateTag::CANONICAL);
106 * The date
109 $date = $tagAttributes->getComponentAttributeValue(DateTag::DATE_ATTRIBUTE, $defaultDateTime);
111 return DateTag::formatDateString($date, $format, $lang);
113 $message = "Error while formatting a date. Error: {$e->getMessage()}";
125 $date = $call->getCapturedContent();
126 $openingTag->addAttribute(DateTag::DATE_ATTRIBUTE, $date);