<?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: Fetrarij</title>
    <description>The latest articles on DEV Community by Fetrarij (@fetrarij).</description>
    <link>https://dev.to/fetrarij</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4181550%2Fa31c5804-2cea-42aa-8fe8-4ab621282568.png</url>
      <title>DEV Community: Fetrarij</title>
      <link>https://dev.to/fetrarij</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fetrarij"/>
    <language>en</language>
    <item>
      <title>ngx-daterangepicker-material is back: Angular 22, SSR, zoneless and Signal Forms</title>
      <dc:creator>Fetrarij</dc:creator>
      <pubDate>Tue, 13 Oct 2026 08:23:50 +0000</pubDate>
      <link>https://dev.to/fetrarij/ngx-daterangepicker-material-is-back-angular-22-ssr-zoneless-and-signal-forms-1755</link>
      <guid>https://dev.to/fetrarij/ngx-daterangepicker-material-is-back-angular-22-ssr-zoneless-and-signal-forms-1755</guid>
      <description>&lt;p&gt;ngx-daterangepicker-material is a date range picker for Angular. It has predefined ranges (Today,Last 7 days, This month...), an optional time picker, and a Material look.&lt;/p&gt;

&lt;p&gt;It is downloaded about 250,000 times a month on npm. But after version 6.0.4 in October 2022, there was no new release until 2026. No support for new Angular versions, and close to 200 open issues. Some of them simply asked: "Is this project alive?"&lt;/p&gt;

&lt;p&gt;It is. Here is what happened, what changed, and how to upgrade.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it stopped
&lt;/h2&gt;

&lt;p&gt;There was no big drama. At first, I just had no time for a few months. During that time, new issues kept coming. When I came back, the list was long, and every issue felt like a small debt.&lt;/p&gt;

&lt;p&gt;Then the CI started to fail. The build broke on a clean checkout, the tests did not start in a modern Chrome, the demo deploy failed. Each fix needed hours I didn't have. So I pushed it to "later", again and again, until I was close to giving up.&lt;/p&gt;

&lt;p&gt;This year I took the time to fix the boring part first: build, tests, CI, demo deploy. After that, answering issues felt possible again.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the library does
&lt;/h2&gt;

&lt;p&gt;You put a directive on an input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;ngxDaterangepickerMd&lt;/span&gt; &lt;span class="na"&gt;[ranges]=&lt;/span&gt;&lt;span class="s"&gt;"ranges"&lt;/span&gt; &lt;span class="na"&gt;[timePicker]=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt; &lt;span class="na"&gt;[(ngModel)]=&lt;/span&gt;&lt;span class="s"&gt;"selected"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;dayjs&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dayjs/esm&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;DateRanges&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ngx-daterangepicker-material&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ranges&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;DateRanges&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Today&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;dayjs&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nf"&gt;dayjs&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Yesterday&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;dayjs&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;subtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;day&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;dayjs&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;subtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;day&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Last 7 days&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;dayjs&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;subtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;day&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;dayjs&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;This month&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;dayjs&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;startOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;month&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;dayjs&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;endOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;month&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The value is &lt;code&gt;{ startDate, endDate }&lt;/code&gt;, as dayjs dates. If you build dashboards, reports or filters, you know why presets matter: users don't want to click 30 days on a calendar, they want to click "Last 30 days".&lt;/p&gt;

&lt;h2&gt;
  
  
  Catching up with Angular
&lt;/h2&gt;

&lt;p&gt;The package now follows Angular versions: v16 works with Angular 16, v17 with Angular 17, and so on up to v22. The version number tells you the Angular version.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ng update&lt;/code&gt; only moves one major at a time, so I went through each one. At each step I built the library, created a fresh Angular app, installed the packed library in it, and checked in a real browser that picking a date really changes the value. That last check found bugs that my own build never showed, because a fresh app does not have the same config as my repo.&lt;/p&gt;

&lt;p&gt;The latest version works with standalone components, SSR and zoneless apps, and &lt;code&gt;ng add&lt;/code&gt; sets it up for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixing the backlog
&lt;/h2&gt;

&lt;p&gt;Then I read every open issue, even the ones from 2018. Many bugs were real and still there: wrong dates with time zones, the calendar showing the wrong month, a calendar cut by &lt;code&gt;mat-form-field&lt;/code&gt;, missing events...&lt;/p&gt;

&lt;p&gt;Most of them are fixed now, each one with a test. The library had almost no tests before; it has about 140 now. Today there are about 13 open issues, and new issues get a reply.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's new in 22.2
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Signal Forms: &lt;code&gt;[formField]&lt;/code&gt; works on the input and on the inline calendar (22.2.1).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[(ngModel)]&lt;/code&gt; and &lt;code&gt;[formControl]&lt;/code&gt; work on the inline calendar.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[appendToBody]="true"&lt;/code&gt;: the calendar is not cut anymore inside &lt;code&gt;mat-form-field&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The calendar stays inside the window and follows the input on scroll.&lt;/li&gt;
&lt;li&gt;Change the language at runtime with &lt;code&gt;LocaleService.setConfig()&lt;/code&gt;, or give a signal to &lt;code&gt;forRoot()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;New events: &lt;code&gt;cancelClicked&lt;/code&gt; and &lt;code&gt;customRangeClicked&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[disabled]&lt;/code&gt; works without a form.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why not the Angular Material date range picker?
&lt;/h2&gt;

&lt;p&gt;Good question. I asked it to myself before spending weeks on this.&lt;/p&gt;

&lt;p&gt;Material has a very good date range picker. But it has &lt;strong&gt;no predefined ranges&lt;/strong&gt; (you can build them with a custom calendar header, but you write and maintain that code), no time on a range (the Material timepicker is for one date), and it uses two inputs.&lt;/p&gt;

&lt;p&gt;This library has presets, a time picker, and one input where users can type or pick the whole range. It does &lt;strong&gt;not&lt;/strong&gt; depend on &lt;code&gt;@angular/material&lt;/code&gt;. It only looks like it, so it fits next to Material components, and works in apps without Material too.&lt;/p&gt;

&lt;p&gt;What about other libraries? To be fair: &lt;code&gt;ngx-bootstrap&lt;/code&gt; and &lt;code&gt;ng-zorro&lt;/code&gt; also have presets and a time picker on ranges, and &lt;code&gt;PrimeNG&lt;/code&gt; has the time picker. They are good choices &lt;strong&gt;if your app already uses them&lt;/strong&gt;. But they come with their own design system. If you only need a date range picker, adding a whole UI kit for it is a lot. This library does one thing.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Presets&lt;/th&gt;
&lt;th&gt;Time on a range&lt;/th&gt;
&lt;th&gt;Needs a UI kit&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ngx-daterangepicker-material&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Angular Material&lt;/td&gt;
&lt;td&gt;no (custom code)&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;Angular Material&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ngx-bootstrap&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;Bootstrap&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ng-zorro&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;Ant Design&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PrimeNG&lt;/td&gt;
&lt;td&gt;no (custom template)&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;PrimeNG&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Coming from v6?
&lt;/h2&gt;

&lt;p&gt;Most people still are: about 7 installs out of 10 are v6. If you saw a deprecation warning when running &lt;code&gt;npm install&lt;/code&gt;, this is why. Versions before 16 are not maintained anymore.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"^6.0.4"&lt;/code&gt; in your &lt;code&gt;package.json&lt;/code&gt; never moves to a newer major, so you have to choose the version yourself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;ngx-daterangepicker-material@22   &lt;span class="c"&gt;# for Angular 22&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The API is the same: &lt;code&gt;NgxDaterangepickerMd.forRoot()&lt;/code&gt;, the same inputs and outputs. A few things behave better now, and you may notice them. The most important one: the emitted dates are the real&lt;br&gt;
local dates. If you added code to fix a timezone shift, remove it. The full list is in the &lt;a href="https://github.com/fetrarij/ngx-daterangepicker-material#upgrade-from-6x" rel="noopener noreferrer"&gt;README&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If something breaks during the upgrade, please open an issue. This is exactly what I want to hear about right now.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is not great yet
&lt;/h2&gt;

&lt;p&gt;I prefer to say it before you find it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;there is no keyboard navigation inside the calendar yet. This is an accessibility problem, and the most important missing feature;&lt;/li&gt;
&lt;li&gt;the layout on small screens needs work;&lt;/li&gt;
&lt;li&gt;the main component is still one big class of about 1,600 lines. It works, and it has tests now, but it will be split.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Next: v23
&lt;/h2&gt;

&lt;p&gt;v23 will come with Angular 23. The plan is in a pinned issue: &lt;code&gt;provideDaterangepicker()&lt;/code&gt; for standalone apps, signal inputs, keyboard support, and a few small breaking changes announced early. One choice is still open, and I want your opinion: should the calendar use Angular CDK Overlay? It would fix the calendar cut by &lt;code&gt;mat-form-field&lt;/code&gt; without any option, but it adds &lt;code&gt;@angular/cdk&lt;/code&gt; as a dependency. &lt;a href="https://github.com/fetrarij/ngx-daterangepicker-material/discussions/603" rel="noopener noreferrer"&gt;Please vote here&lt;/a&gt;, it takes ten seconds. Comments on the roadmap are welcome too.&lt;/p&gt;

&lt;p&gt;Comments are welcome there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ng add ngx-daterangepicker-material
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;StackBlitz: &lt;a href="https://stackblitz.com/github/fetrarij/ngx-daterangepicker-material/tree/master/examples/stackblitz" rel="noopener noreferrer"&gt;https://stackblitz.com/github/fetrarij/ngx-daterangepicker-material/tree/master/examples/stackblitz&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Demo: &lt;a href="https://fetrarij.github.io/ngx-daterangepicker-material/" rel="noopener noreferrer"&gt;https://fetrarij.github.io/ngx-daterangepicker-material/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/fetrarij/ngx-daterangepicker-material" rel="noopener noreferrer"&gt;https://github.com/fetrarij/ngx-daterangepicker-material&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  You can help
&lt;/h2&gt;

&lt;p&gt;If you use this library at work, the best help is simple: upgrade, and tell me if something broke.&lt;/p&gt;

&lt;p&gt;If you want to write code, some issues have the &lt;a href="https://github.com/fetrarij/ngx-daterangepicker-material/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issue&lt;/a&gt;label, and &lt;a href="https://github.com/fetrarij/ngx-daterangepicker-material/blob/master/CONTRIBUTING.md" rel="noopener noreferrer"&gt;CONTRIBUTING.md&lt;/a&gt; explains how to start in a few commands. A star on GitHub also helps other people find the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  One thing I learned
&lt;/h2&gt;

&lt;p&gt;I thought bringing the project back would need a big plan and a rewrite. It didn't. It needed someone to answer the issues, one by one, and to ship small releases often. People are very patient with an open source project, as long as someone is there.&lt;/p&gt;

&lt;p&gt;Thanks to everyone who kept using it, and to everyone who reported bugs and shared workarounds during the quiet years. You kept it alive.&lt;/p&gt;

</description>
      <category>angular</category>
      <category>typescript</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
