Socket
Socket
Sign inDemoInstall

ng2-datetime

Package Overview
Dependencies
186
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ng2-datetime

Bootstrap datetime picker for Angular2


Version published
Maintainers
1
Created

Readme

Source

ng2-datetime

npm version

Datetime picker plugins wrapper for Angular2.

DEMO: https://nkalinov.github.io/ng2-datetime

Dependencies

  • Bootstrap3 (CSS only)
  • jQuery 2.x
  • Bootstrap-datepicker (JS+CSS) npm install --save bootstrap-datepicker or use the bundled version from src/vendor/bootstrap-datepicker
  • Bootstrap-timepicker (JS+CSS) npm install --save bootstrap-timepicker or use the bundled version from src/vendor/bootstrap-timepicker

Installation

npm install --save ng2-datetime

Usage

  1. import some way or another the required dependencies If you want to use the bundled versions, you can import them like this:
import 'ng2-datetime/src/vendor/bootstrap-datepicker/bootstrap-datepicker.min.js';
import 'ng2-datetime/src/vendor/bootstrap-timepicker/bootstrap-timepicker.min.js';

The bundled CSS is in the same folder, it's up to you to decide how to import those. 2. import {NKDatetime} from 'ng2-datetime/ng2-datetime'; 3. Add to your component's directives property

@Component({
    ...
    directives: [NKDatetime],
    ...
})
  • Basic usage: <datetime [(ngModel)]="date"></datetime> See the DEMO and it source for more information.

Options

  • [datepicker]="{Object} || false" - Object with Datepicker options or false if you want to remove the datepicker Ex. <datetime [datepicker]="{daysOfWeekDisabled: [0,6]}" [(ngModel)]="date"></datetime>

  • [timepicker]="{Object} || false" - Object with Timepicker options or false if you want to remove the timepicker Ex. <datetime [timepicker]="{showMeridian: false, minuteStep: 1}" [(ngModel)]="date"></datetime>

Contributing

Fork > Create > Pull request

Thanks

TODO:

  • test ControlValueAccessor

Keywords

FAQs

Last updated on 27 Jul 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc