npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ngx-angular-datepicker

v1.2.3

Published

Persian Jalali datepicker component for Angular with RTL support, Persian numbers, custom date formats and optional time picker.

Readme

ngx-angular-datepicker

A modern Persian Jalali (Shamsi) Datepicker component for Angular applications.

ngx-angular-datepicker is a lightweight Angular date picker designed for Persian applications with full Jalali calendar support, RTL layout, Persian numbers, custom date formats, optional time picker, date restrictions, and Angular Forms support.

Features

✨ Features included:

  • 🇮🇷 Jalali (Shamsi) calendar support
  • 🔢 Persian number formatting
  • ↔️ RTL support
  • 📅 Month and year selection
  • ⏰ Optional time picker
  • 🎨 Custom date format support
  • 🗓 Correct Jalali leap year handling
  • ⚡ Angular Standalone Component support
  • 📦 NgModule support
  • 📝 Reactive Forms support
  • 🔗 ControlValueAccessor support
  • 🚫 Min / Max date limitation
  • 🚫 Disable specific dates
  • 🎯 Modern and lightweight UI

Installation

Install the package using npm:

npm install ngx-angular-datepicker

Usage

Standalone Component

For Angular standalone applications:

import { Component } from '@angular/core';
import { NgxDatePickerComponent, JalaliDate } from 'ngx-angular-datepicker';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [NgxDatePickerComponent],
  template: `
    <ngx-date-picker [value]="selectedDate" (dateChange)="onDateChange($event)"> </ngx-date-picker>
  `,
})
export class AppComponent {
  selectedDate: JalaliDate = {
    year: 1405,
    month: 4,
    day: 20,
  };

  onDateChange(date: JalaliDate): void {
    console.log('Selected date:', date);
  }
}

NgModule Support

The package also supports traditional Angular module based applications.

Import the module:

import { NgxAngularDatepickerModule } from 'ngx-angular-datepicker';

@NgModule({
  imports: [NgxAngularDatepickerModule],
})
export class AppModule {}

Then use:

<ngx-date-picker> </ngx-date-picker>

Basic Example

<ngx-date-picker> </ngx-date-picker>

If no value is provided, the component automatically uses today's Jalali date.


Set Default Date

You can provide an initial selected date:

<ngx-date-picker
  [value]="{
  year: 1405,
  month: 4,
  day: 20
}"
>
</ngx-date-picker>

Output:

{
  year: 1405,
  month: 4,
  day: 20
}

Reactive Forms Support

The date picker supports Angular Reactive Forms using ControlValueAccessor.

Example:

import { FormControl } from '@angular/forms';
import { JalaliDate } from 'ngx-angular-datepicker';

birthDate = new FormControl<JalaliDate | null>({
  year: 1405,
  month: 4,
  day: 20,
  hour: 14,
  minute: 30,
});

HTML:

<ngx-date-picker [formControl]="birthDate"> </ngx-date-picker>

Selected value:

{
  year: 1405,
  month: 4,
  day: 20,
  hour: 14,
  minute: 30
}

Enable Time Picker

Enable hour and minute selection:

<ngx-date-picker [enableTime]="true"> </ngx-date-picker>

Output:

{
  year: 1405,
  month: 4,
  day: 20,
  hour: 14,
  minute: 30
}

Custom Date Format

You can customize the displayed date format:

<ngx-date-picker format="DD MMMM YYYY"> </ngx-date-picker>

Examples:

| Format | Output | | -------------- | ------------- | | YYYY/MM/DD | ۱۴۰۵/۰۵/۲۰ | | DD-MM-YYYY | ۲۰-۰۵-۱۴۰۵ | | DD MMMM YYYY | ۲۰ مرداد ۱۴۰۵ | | MMMM YYYY | مرداد ۱۴۰۵ |

Available tokens:

| Token | Description | | ----- | ------------------ | | YYYY | Jalali year | | MM | Numeric month | | DD | Numeric day | | MMMM | Persian month name |


Min Date / Max Date

Limit selectable dates:

<ngx-date-picker
  [minDate]="{
  year:1405,
  month:1,
  day:1
}"
  [maxDate]="{
  year:1405,
  month:6,
  day:1
}"
>
</ngx-date-picker>

Disable Specific Dates

Disable selected dates:

<ngx-date-picker
  [disabledDates]="[

 {
   year:1405,
   month:4,
   day:10
 },

 {
   year:1405,
   month:4,
   day:11
 }

]"
>
</ngx-date-picker>

Disable Component

<ngx-date-picker [disabled]="true"> </ngx-date-picker>

Placeholder

Custom input placeholder:

<ngx-date-picker placeholder="تاریخ تولد"> </ngx-date-picker>

Complete Example

<ngx-date-picker
  placeholder="تاریخ تولد"
  [value]="selectedDate"
  [minDate]="{
  year:1405,
  month:1,
  day:1
}"
  [maxDate]="{
  year:1405,
  month:12,
  day:29
}"
  [disabledDates]="disabledDates"
  [enableTime]="true"
  format="DD MMMM YYYY"
  (dateChange)="onDateChange($event)"
>
</ngx-date-picker>

JalaliDate Interface

export interface JalaliDate {
  year: number;

  month: number;

  day: number;

  hour?: number;

  minute?: number;
}

Configuration Options

| Option | Type | Default | Description | | ------------- | ------------ | ------------ | ----------------------- | | value | JalaliDate | undefined | Initial selected date | | placeholder | string | انتخاب تاریخ | Input placeholder | | enableTime | boolean | false | Enable time picker | | format | string | YYYY/MM/DD | Display format | | minDate | JalaliDate | undefined | Minimum selectable date | | maxDate | JalaliDate | undefined | Maximum selectable date | | disabledDates | JalaliDate[] | [] | Disabled dates | | disabled | boolean | false | Disable component |


Angular Compatibility

| Angular Version | Support | | --------------- | ------- | | Angular 20 | ✅ | | Angular 19 | ✅ | | Angular 18 | ✅ | | Angular 17 | ✅ | | Angular 16 | ✅ | | Angular 15 | ✅ |


Contributing

Contributions are welcome ❤️

If you find a bug, have an idea, or want to improve this project:

  • Open an issue
  • Submit a pull request
  • Share your feedback

I would be happy to see developers from the Angular community contribute and help make this package better.


Author

Created by Araz Shamsaddinlouy

Senior Front-End Engineer focused on:

  • Angular
  • React
  • Next.js
  • TypeScript

Connect with me

LinkedIn:

https://linkedin.com/in/araz-shams

Portfolio:

https://arazshams.vercel.app

GitHub:

https://github.com/arazshamsaddinlouy


License

MIT License