Code Monkey home page Code Monkey logo

lc-datepicker's Introduction

Logo of the project

LC DatePicker

Pure Angular date and time picker component.

npm version

Build Status

Demo

Click here for preview

Description

  • LC DatePicker is an Angular component that generates a datepicker calendar on your input element
  • Compatible with Angular 2+ up to Angular v6.0.0
  • Only dependencies are RxJS, MomentJS and Font Awesome
  • Customizable date format and language
  • Can be configured as time, date-time, date, month or year picker

Tested with

  • Firefox (latest)
  • Chrome (latest)
  • Chromium (latest)
  • Edge
  • IE11

Installing / Getting started

npm install @libusoftcicom/lc-datepicker

skip this if SystemJS is not used as module loader:

System.config({
  paths: {
    'npm:': 'node_modules/'
  },
  map: {
    '@libusoftcicom/lc-datepicker' : 'npm:@libusoftcicom/lc-datepicker/bundles/lc-datepicker.umd'
  }
})

Use the following snippet inside your app module:

import {LcDatePickerModule} from '@libusoftcicom/lc-datepicker';

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...
    ,LcDatePickerModule
  ],
  providers: [
    ...
  ],
  bootstrap: [...]
})
export class AppModule {}

Use the following snippet inside your component:

import {DatePickerConfig, ECalendarType} from '@libusoftcicom/lc-datepicker';


@Component({
  ...
})
export class AppComponent {

  private dateValue: string = null;
  public config = new DatePickerConfig();
  public CalendarOpened: boolean = false;

  constructor() {

    // configuration is optional
    this.config.CalendarType = ECalendarType.Date;
    this.config.Localization = 'en';
    ...
  }

  public get Date() {
    return this.dateValue;
  }

  public set Date(value: string) {
    this.dateValue = value;
  }

}

Use the following snippet inside your template:

<lc-datepicker [(opened)]="CalendarOpened" [config]="config" [(date)]="Date"></lc-datepicker>

DatePicker config parameters

  • CalendarType: ECalendarType
  • Localization: String
  • MaxYear: Number
  • MinYear: Number
  • MaxMonth: Number
  • MinMonth: Number
  • MaxDay: Number
  • MinDay: Number
  • ConfirmLabel: String
  • PrimaryColor: String
  • FontColor: String
  • Format: Moment.MomentInput
  • setDisabledDates( Array<Moment.MomentInput> )
  • addDisabledTimeRange( start<Moment.MomentInput>, stop<Moment.MomentInput> )

Developing

Built With:

  • Angular
  • MomentJS
  • Font Awesome

Setting up Dev

This project was generated with Angular CLI version 6.0.2.

Angular CLI must be installed before building LC DatePicker component.

npm install -g @angular/cli
git clone https://github.com/LibusoftCicom/lc-datepicker.git
cd lc-datepicker/
npm install
npm run start

Open "http://localhost:4200" in browser

Building

This project was generated with Angular CLI version 6.0.2.

Angular CLI must be installed before building LC DatePicker component.

npm install -g @angular/cli
git clone https://github.com/LibusoftCicom/lc-datepicker.git
cd lc-datepicker/
npm install
npm run build

Versioning

We use SemVer for versioning. For the versions available, see the link to tags on this repository.

Tests

This project was generated with Angular CLI version 6.0.2.

Angular CLI must be installed before building LC DatePicker component.

npm install -g @angular/cli
git clone https://github.com/LibusoftCicom/lc-datepicker.git
cd lc-datepicker/
npm install
npm run test

Contributing

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our contributing guide and code of conduct and then check out one of our issues.

Licensing

LC DatePicker is freely distributable under the terms of the MIT license.

lc-datepicker's People

Contributors

mematija avatar

Watchers

Baron Ntambwe avatar

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.