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-arabic-datepicker

v1.0.1

Published

A beautiful, reusable Angular datepicker component with full Arabic language support, RTL layout, and custom styling

Readme

ngx-arabic-datepicker

🗓️ A beautiful, reusable Angular datepicker component with full Arabic language support, RTL layout, and custom styling.

✨ Features

  • 🌍 Multi-language Support: Arabic and French languages with dynamic switching
  • 📱 RTL Layout: Full right-to-left support for Arabic
  • 🎨 Custom Styling: Professional design with customizable colors
  • 🔧 Angular Forms: Full ControlValueAccessor implementation
  • 📅 ng-bootstrap Integration: Built on top of ng-bootstrap datepicker
  • 🎯 Accessibility: ARIA labels and keyboard navigation
  • 📦 Standalone Component: Easy to integrate and use

🚀 Installation

npm install ngx-arabic-datepicker

Peer Dependencies

Make sure you have the following peer dependencies installed:

npm install @angular/common @angular/core @angular/forms
npm install @ng-bootstrap/ng-bootstrap @ngx-translate/core rxjs

📖 Usage

1. Import the Module

import { NgxArabicDatepickerModule } from 'ngx-arabic-datepicker';

@NgModule({
  imports: [
    NgxArabicDatepickerModule,
    // ... other imports
  ],
  // ...
})
export class AppModule { }

2. Use in Template

<lib-ngx-arabic-datepicker
  [(ngModel)]="selectedDate"
  [placeholder]="'yyyy-mm-dd'"
  [errorMessage]="errorMessage"
  [disabled]="false"
  (dateChange)="onDateChange($event)">
</lib-ngx-arabic-datepicker>

3. Component Setup

import { Component } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';

@Component({
  selector: 'app-example',
  templateUrl: './example.component.html'
})
export class ExampleComponent {
  selectedDate = '';
  errorMessage = '';

  constructor(private translateService: TranslateService) {
    // Set language (Arabic or French)
    this.translateService.use('ar'); // or 'fr'
  }

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

🎛️ API Reference

Inputs

| Property | Type | Default | Description | |----------|------|---------|-------------| | placeholder | string | 'yyyy-mm-dd' | Input placeholder text | | name | string | '' | Input name attribute | | maxDate | NgbDate | undefined | Maximum selectable date | | minDate | NgbDate | undefined | Minimum selectable date | | disabled | boolean | false | Disable the datepicker | | readonly | boolean | true | Make input readonly | | containerClass | string | '' | Additional CSS classes | | inputClass | string \| object | '' | Input CSS classes | | errorMessage | string | '' | Error message to display |

Outputs

| Event | Type | Description | |-------|------|-------------| | dateChange | EventEmitter<string> | Emitted when date changes |

Methods

| Method | Description | |--------|-------------| | getAriaLabel() | Returns localized ARIA label | | isRTL | Getter that returns true for Arabic language |

🌍 Language Support

The component automatically detects the current language from @ngx-translate/core and switches between:

  • Arabic (ar): RTL layout with Arabic month names
  • French (fr): LTR layout with French month names

Arabic Features

  • Arabic month names: يناير، فبراير، مارس...
  • Arabic weekday names: الأحد، الإثنين، الثلاثاء...
  • RTL text direction
  • Icon positioned on the left side

🎨 Styling

The component comes with beautiful default styling using a red theme (#EC3745). You can customize it by overriding CSS variables or classes.

Custom Colors

::ng-deep .ngb-dp-popup {
  .btn-primary,
  .bg-primary {
    background: #your-color !important;
    border-color: #your-color !important;
  }
}

🔧 Form Integration

The component implements ControlValueAccessor and works seamlessly with Angular forms:

Reactive Forms

import { FormBuilder, FormGroup, Validators } from '@angular/forms';

export class MyComponent {
  form: FormGroup;

  constructor(private fb: FormBuilder) {
    this.form = this.fb.group({
      birthDate: ['', Validators.required]
    });
  }
}
<form [formGroup]="form">
  <lib-ngx-arabic-datepicker
    formControlName="birthDate"
    [errorMessage]="form.get('birthDate')?.errors?.['required'] ? 'Date is required' : ''"
  ></lib-ngx-arabic-datepicker>
</form>

Template-driven Forms

<lib-ngx-arabic-datepicker
  [(ngModel)]="selectedDate"
  name="birthDate"
  #dateInput="ngModel"
  required
  [errorMessage]="dateInput.errors?.['required'] ? 'Date is required' : ''"
></lib-ngx-arabic-datepicker>

🛠️ Development

Building the Library

ng build ngx-arabic-datepicker

Publishing

cd dist/ngx-arabic-datepicker
npm publish

📄 License

MIT License - see the LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📞 Support

If you have any questions or issues, please open an issue on GitHub.


Made with ❤️ for the Arabic-speaking Angular community