<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Nette Framework forum : Uživatelé Nette Framework : Latte : Latte LocalDate (3.0.18) – nastavení</title>
<link>https://forum.nette.org/cs</link>
<description>Nette Framework forum</description>
<language>cs</language>
<docs>http://backend.userland.com/rss</docs>
<item>
	<title>Latte LocalDate (3.0.18) – nastavení (Latte)</title>
	<dc:creator>Pavel Kravčík</dc:creator>
	<link>https://forum.nette.org/cs/36607#p227437</link>
	<guid isPermaLink="false">227437@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Až se bude doupravovat do konfigurace:&lt;/p&gt;

&lt;pre
class=&quot;language-neon&quot;&gt;&lt;code&gt;	@Nette\Bridges\ApplicationLatte\LatteFactory:
		setup:
			- setLocale(cs)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Bylo by fajn přidat také defaultní nastavení formátu pro filtr
&lt;code&gt;localDate&lt;/code&gt; a výsledek by mohl vypadat třeba takto
v konfiguraci:&lt;/p&gt;

&lt;pre
class=&quot;language-neon&quot;&gt;&lt;code&gt;latte:
	locale: cs
	dateFormat: IntlDateFormatter::MEDIUM&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Na prasáka kdyby někdo chtěl, tak tady patch pro composer :)&lt;/p&gt;

&lt;pre
class=&quot;language-git&quot;&gt;&lt;code&gt;diff --git a/src/Latte/Essential/Filters.php b/src/Latte/Essential/Filters.php
index 86edc8ea..2279f72e 100644
--- a/src/Latte/Essential/Filters.php
+++ b/src/Latte/Essential/Filters.php
@@ -221,7 +221,7 @@ public function localDate(
 		if ($format === null) {
 			$xlt = [&apos;&apos; =&amp;gt; \IntlDateFormatter::NONE, &apos;full&apos; =&amp;gt; \IntlDateFormatter::FULL, &apos;long&apos; =&amp;gt; \IntlDateFormatter::LONG, &apos;medium&apos; =&amp;gt; \IntlDateFormatter::MEDIUM, &apos;short&apos; =&amp;gt; \IntlDateFormatter::SHORT,
 				&apos;relative-full&apos; =&amp;gt; \IntlDateFormatter::RELATIVE_FULL, &apos;relative-long&apos; =&amp;gt; \IntlDateFormatter::RELATIVE_LONG, &apos;relative-medium&apos; =&amp;gt; \IntlDateFormatter::RELATIVE_MEDIUM, &apos;relative-short&apos; =&amp;gt; \IntlDateFormatter::RELATIVE_SHORT];
-			$date ??= $time === null ? &apos;long&apos; : null;
+			$date ??= $time === null ? &apos;medium&apos; : null;
 			$options = [$xlt[$date], $xlt[$time]];
 		} else {
 			$options = (new \IntlDatePatternGenerator($this-&amp;gt;locale))-&amp;gt;getBestPattern($format);
&lt;/code&gt;&lt;/pre&gt;
</description>
	<pubDate>Tue, 13 Aug 2024 21:31:39 +0200</pubDate>
</item>
</channel>
</rss>
