1.1.26 • Published 11 months ago

nep-datepicker v1.1.26

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Nepali Datepicker Angular

The Angular Nepali Datepicker is an npm package designed to integrate a Nepali date picker component into Angular applications. This package allows users to select dates using the Nepali calendar system, which is different from the Gregorian calendar commonly used in many parts of the world.

Here is a detailed description of the package:

Key Features:

  • Nepali Calendar Integration: The date picker supports the Nepali calendar, allowing users to select dates based on the Bikram Sambat (BS) calendar system.

  • Angular Compatibility: Designed to work seamlessly with Angular applications, making it easy to integrate into your existing project.

  • User-Friendly Interface: Provides a visually appealing and easy-to-use interface for selecting dates.

  • Customization Options: Offers various options to customize the appearance and behavior of the date picker to suit different application needs.

  • Localization: Supports localization features to display dates and interface elements in the Nepali language.

Datepicker with both AD and BS feature.

See Demo and Documentation for more information.

Installation

npm i nep-datepicker

Version support

Angular is a platform and framework for building single-page client applications using HTML and TypeScript. Developed and maintained by Google, it provides a comprehensive suite of tools and features for developing robust and scalable web applications.

This package is designed to support only Angular version 12 and above. It leverages the latest features and improvements introduced in Angular 12, ensuring optimal performance, security, and compatibility. By focusing on Angular 12+, the package benefits from enhanced TypeScript support, improved build and compilation processes, and advanced tooling provided by the Angular CLI. This ensures that users can take full advantage of modern Angular capabilities for building robust and scalable web applications.

Read More about Angular.

Usages

On app.module.ts

import { NepaliDatepickerModule } from 'nep-datepicker';


@NgModule({
  declarations: [...],
  imports: [..., NepaliDatepickerModule, ...],
  providers: [...],
  bootstrap: [...],
})

on component to use

<ne-datepicker [date]="date" dateIn="AD" (dateInBS)="updateNepaliDate($event)" (dateInAD)="updateEnglishDate($event)"> </ne-datepicker>

Properties

PropertyTypeDefaultDescription
datestring-Date value in string in format yyyy/mm/dd or specific formate specify in dateFormat property.
dateFormatstringyyyy/mm/ddDate format for date property and also used for the output date format.
dateInstringBSDate type of the given date input. Accepts BS or AD.
minDatedate-Minimum selectable date in AD
maxDatedate-Maximum selectable date in AD.
languagestringneLanguage for the datepicker view. Accept only ne(Nepali) or en(English)
PlaceholderstringEnter datePlaceholder value to display
hasMultipleCalendarViewbooleanTrueAllow to switch datepicker with AD and BS date type
isErrorbooleanFalseFlag to indicate error state and show error outline
primaryColorstring-Color value for datepicker primary color. Accept string color name or the hex color value.
darkThemebooleanFalseFlag to set dark theme or light theme for the datepicker view.

Events

EventParameterDescription
dateInADdateValueEmits on date selected on datepicker view, Date(AD) value in string with the given dateFormat. Default to yyyy/mm/dd format
dateInBSdateValueEmits on date selected on datepicker view, Date(BS) value in string with the given dateFormat. Default to yyyy/mm/dd format

Services

Services to converter AD to BS or BS to AD dates.

import { NepaliDatepickerService } from 'nepali-datepicker-angular';

    constructor (private _nepaliDatepickerService: NepaliDatepickerService) {
          const ADDate = this._nepaliDatepickerService.BSToAD(BSDate, 'yyyy/mm/dd');
          const BSDate = this._nepaliDatepickerService.ADToBS(ADDate, 'yyyy/mm/dd');
        }
        
  • ADToBS

    • Converts AD Date to BS Date. It requires 2 arguments, - AD date in string - format of the AD date returns BS date in string with same format as of AD date.
  • BSToAD

    • Converts BS Date to AD Date. It requires 2 arguments, - BS date in string - format of the AD date returns AD date in string with same format as of BS date.

Link to NPM package.

1.1.26

11 months ago

1.1.25

11 months ago

1.1.24

11 months ago

1.1.22

11 months ago

1.1.21

11 months ago

1.1.20

11 months ago

1.1.19

11 months ago

1.1.18

11 months ago

1.1.17

11 months ago

1.1.16

11 months ago

1.1.15

11 months ago

1.1.14

11 months ago

1.1.12

11 months ago

1.1.11

11 months ago

1.1.1

11 months ago

1.1.0

11 months ago