<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eneko Alonso</title>
    <description>The latest articles on DEV Community by Eneko Alonso (@eneko).</description>
    <link>https://dev.to/eneko</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F436491%2Fa7d5aae3-e4c6-489a-84ce-383d6d0ed33b.jpeg</url>
      <title>DEV Community: Eneko Alonso</title>
      <link>https://dev.to/eneko</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eneko"/>
    <language>en</language>
    <item>
      <title>Using DateTemplates in SwiftUI for custom date formatting</title>
      <dc:creator>Eneko Alonso</dc:creator>
      <pubDate>Thu, 23 Jul 2020 15:18:01 +0000</pubDate>
      <link>https://dev.to/eneko/using-datetemplates-in-swiftui-for-custom-date-formatting-1khn</link>
      <guid>https://dev.to/eneko/using-datetemplates-in-swiftui-for-custom-date-formatting-1khn</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/eneko/DateTemplates"&gt;DateTemplates&lt;/a&gt; is a library that provides a simple way to generate date formatting templates that can be used to format dates in all Apple platforms and Linux. With a declarative Swift syntax that's easy to read and natural to write, &lt;code&gt;DateTemplate&lt;/code&gt; works seamlessly with &lt;code&gt;DateFormatter&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In SwiftUI, we can use it to easily format dates inline with out view code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Text(
    DateTemplate()
        .dayOfWeek(.full)
        .month(.abbreviated)
        .day()
        .time()
        .localizedString(from: entry.timestamp)
)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Mp9QZnUS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/85vfyhksdaouevzvzkwx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Mp9QZnUS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/85vfyhksdaouevzvzkwx.png" alt="Using DateTemplate in SwiftUI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Visit &lt;a href="https://github.com/eneko/DateTemplates"&gt;https://github.com/eneko/DateTemplates&lt;/a&gt; for more examples and documentation.&lt;/p&gt;

</description>
      <category>swift</category>
      <category>swiftui</category>
      <category>dateformatting</category>
    </item>
  </channel>
</rss>
