Giter Site home page Giter Site logo

changhuixu / date-range-picker Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 5.0 2.45 MB

Angular components for Date Range Picker and Date Picker using ng-bootstrap

Home Page: https://changhuixu.github.io/date-range-picker/

HTML 23.80% TypeScript 68.63% CSS 2.39% JavaScript 5.17%
datepicker daterangepicker angular daterange-picker boostrap4 bootstrap ngbootstrap date-range-picker daterange date-range

date-range-picker's Introduction

DateRangePicker

An Angular library of Date Range Picker. Dependencies: Angular, ng-bootstrap, Bootstrap >4 (css)

Since v7.0.0, this library is only compatible with Angular >=13 and ng-bootstrap >=12.

Since v6.0.0, this library is only compatible with Angular >=13 and ng-bootstrap >=11.

Since v5.0.0, this library is only compatible with Angular >=12 and ng-bootstrap >=10.

Since v4.0.0, this library is only compatible with Angular >=10 and ng-bootstrap >=7.

Since v3.0.0, this library requires @angular/localize, due to updates in Angular 9 and ng-bootstrap 6.

Build Status npm

npm i @uiowa/date-range-picker

date range picker demo

Models

  • DateRange: an object represents a date range, includes start date and end date. e.g.,
const d1 = new DateRange();
const d2 = new DateRange(new Date(), new Date(2018, 9, 10));
const d3 = DateRange.nextTwoWeeks();
const d4 = DateRange.nextDays(10);
const d5 = DateRange.nextMonth();

Components

  • <date-picker></date-picker>: a wrapper of ng-bootstrap date picker

  • <date-range-picker></date-range-picker>: a date range picker based on ng-bootstrap

Usage

import { DateRangePickerModule } from '@uiowa/date-range-picker';

@NgModule({
  declarations: [AppComponent],
  imports: [
    ...,
    DateRangePickerModule,
    ...
    ],
  providers: [],
  bootstrap: [AppComponent]
})
// in your component.html
<date-range-picker
  [(dateRange)]="dateRange"
  [maxDate]="maxDate"
></date-range-picker>
<date-picker [(date)]="date"></date-picker>
import { Component, OnInit } from '@angular/core';
import { DateRange } from '@uiowa/date-range-picker';

@Component({
  ...
})
export class AppComponent implements OnInit {
  dateRange = new DateRange();
  maxDate = new Date();
  date: Date;
  ngOnInit(): void {
    this.maxDate.setDate(this.maxDate.getDate() + 20);
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.