0.0.2 • Published 6 years ago

ng-datepickeradvanced v0.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

ng-datepickeradvanced

Installation

Note*: Bootstrap 4.x.x is required.

import { DatePickeAdvancedModule } from 'ng-datepickeradvanced'

For dropdown style add few lines of code as followed.

  • import { DateInput } from 'ng-datepickeradvanced'
<div  id="abDatePicker">
<input  DateInput  disabled [id]="'datePicker'" (dateChange)="callFunction1($event)" />
<i  class=" fas fa-chevron-circle-down"  for="datePicker" (click)="activateDatePicker = !activateDatePicker"></i>
<date-picker-advanced [min]="min" [max]="max" [id]="'datePicker'" *ngIf="activateDatePicker"></date-picker-advanced>
</div>

Note*: ID is required in case to prevent event emitter from invoking on every instance.

-

#abDatePicker > input {
  font-family: cursive;
  background-color: white;
  color: #44046d;
  height: 0;
  padding: 24.5px 47px 24.5px 16px;
  text-decoration: underline;
  font-stretch: ultra-condensed;
  font-size: 15px;
  font-weight: 700;
  width: fit-content;
}
#abDatePicker > i {
color: blueviolet;
margin: 12px -39px;
font-size: 30px;
position: absolute;
cursor: pointer;
}

Demo

  • Single Date Select

npm.io

  • Date Range Select

API

For: app-date-picker-advanced

NameDescription
@Input() min: stringThe minimum valid date.
@Input() max: stringThe maximum valid date.
@Input() id: stringRequired if using more than one instance on same component.

For: input - derivative DateInput

NameDescription
@Input() dateChange: EventEmitter< Object >Emits the output if the value.
@Input() id: stringRequired if using more than one instance on same component.

Results

Date-Range:

{
    from: {
	    date: Date,
	    isValid: Boolean
    },
	to: {
	    date: Date,
	    isValid: Boolean
    }
}

Singular: Date