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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nolanroose/ngx-simple-datepicker

v1.3.0

Published

Very simple datepicker for Angular 15+, using vannillajs-datepicker.

Downloads

5

Readme

NgxSimpleDatepicker

NgxSimpleDatePicker is a custom FormControl with validation, which uses vanillajs-datepicker for the selection by calendar part, and which uses angular2-text-mask for the free input part, witch text-mask-addons

Installation

  1. Firt of all, you need to install:
  • vanillajs-datepicker
    • yarn add vanillajs-datepicker@^1.2.0 or npm install --save vanillajs-datepicker@^1.2.0
    • yarn add -D @types/vanillajs-datepicker@^1.2.1
  • angular2-text-mask
    • yarn add angular2-text-mask@^9.0.0 or npm install --save angular2-text-mask@^9.0.0
  • text-mask-addons
    • yarn add text-mask-addons@^3.8.0 or npm install --save text-mask-addons@^3.8.0
  • luxon
    • yarn add luxon@^3.2.1 or npm install --save luxon@^3.2.1
    • yarn add -D @types/luxon@^3.2.1

Or in one time:

  • yarn add vanillajs-datepicker@^1.2.0 angular2-text-mask@^9.0.0 text-mask-addons@^3.8.0 luxon@^3.0.1
  • yarn add -D @types/vanillajs-datepicker@^1.2.1 @types/luxon@^3.0.0
  1. Then you need to install the package:
npm install --save @nolanroose/ngx-simple-datepicker

or

yarn add @nolanroose/ngx-simple-datepicker

Add to your main style file (style.scss):

@import "~@nolanroose/ngx-simple-datepicker/assets/styles/default-theme";

Usage

in your component:

export class AppComponent implements OnInit {
  public form!: FormGroup;

  public ngOnInit(): void {
    this.form = new FormGroup({
      date: new FormControl('')
    });
  }
}

in your template:

<form [formGroup]="form">
    <ngx-simple-datepicker
      [form]="form"
      [inputKey]="'date'"
      [placeholder]="'test'"
      [formGlobalError]="false"
      [formControlName]="'date'"
      [id]="'date'"
    ></ngx-simple-datepicker>
</form>

example with default theme:

Theming

Copy the variable file from ~@nolanroose/ngx-simple-datepicker/assets/styles/_variables.scss

Paste it into your custom variable themes (custom-datepicker-theme.scss), change the variables.

Import the variable file before the import of default theme:

@import "custom-datepicker-theme.scss";
@import "~@nolanroose/ngx-simple-datepicker/assets/styles/default-theme";

Internationalization

For the moment, the datepicker is only internationalized for the French, English, Spanish languages.

Test locally

  • clone this repository
  • yarn install
  • yarn run build:lib:dev
  • yarn run start

Roadmap

  • [ ] Add internationalization
  • [x] Add tests
  • [ ] Add more documentation
  • [ ] Add configuration service
  • [ ] Add contributions guidelines
  • [ ] Add real ci cd pipeline