vbs-ng-datepicker

A simple and free datepicker to use in Angular projects. Projected to be easily to use.

Usage no npm install needed!

<script type="module">
  import vbsNgDatepicker from 'https://cdn.skypack.dev/vbs-ng-datepicker';
</script>

README

How to use:

Install by npm:

npm install vbs-ng-datepicker

Import in your module:

import { VbsNgDatepickerModule } from 'vbs-ng-datepicker';

...

imports: [

  ...   VbsNgDatepickerModule,

],

Use in your component.html (sample):

<vbs-ng-datepicker

[daysOfTheWeek]="{'1': 'Dom', '2': 'Seg', '3': 'Ter', '4': 'Qua', '5': 'Qui', '6': 'Sex', '7': 'Sab'}"

  min="2019-08-17"

  [max]="someDateObj"

  [(ngModel)]="value"

  displayFormat="yyyy/mm/dd"

  valueFormat="yyyy-mm-dd">

</vbs-ng-datepicker>

Where:

  • min/max can be a string formatted as "yyyy-mm-dd" or a Date object;
  • displayFormat and valueFormat should use yyyy for year, mm for month and dd for day, separated by "/" or "-".
  • displayFormat is about how data is displayed in the input.
  • valueFormat is about control value format;
  • all parameters are optional.