Giter Site home page Giter Site logo

ngx-date-time-picker's Introduction

ngx-date-time-picker

Angular 5 Date-time picker

New

*bug fixes

Installation

npm install ngx-date-time-picker --save

Dependencies

  • Moment.js
  • FormsModule

Plugin Usage

You can use this in the following manner.

  1. Import the package Module as
import { NgxDateTimePickerModule } from  'ngx-date-time-picker';

Then in component file use the date-time-picker as follows:

<ngx-date-time-picker [selectedDateTime]="date" (getData)="getStartDate($event)" [options]="{timePicker: false}" [dateTimeFormat]="'MM/DD/YYYY'"></ngx-date-time-picker>
  • You can now define dateTimeFormat

[selectedDateTime] takes input date defined in the component.ts file as:

date: string;

constructor(){
    this.date = moment().format('DD/MM/YYYY'); //for date-picker
    // this.date = moment().format('hh:mmA');  //for time-picker
}

(getData) will provide the formatted date as $event.

Plugin options

Right now there are only two options to the plugin:

Default options

this.options = {
    datePicker: true,
    timePicker: true
}

If you need datePicker only then pass timePicker: false or vice-versa.

I will soon be updating the plugin with more options.

ngx-date-time-picker's People

Contributors

rajan471 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ngx-date-time-picker's Issues

TS2451: Cannot redeclare block-scoped variable 'ngDevMode'

Hello,

This morning I did the update to angular 6, and I get this issue when I'm doing a npm start
node_modules/ngx-date-time-picker/node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'.

Do you an idea about what is going on?

Thanks for your help
Damien

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.