npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ct-ngx-datepicker-custom

v3.0.6

Published

Angular 2 Datepicker for Centeva projects

Downloads

27

Readme

ct-ngx-datepticker Build Status

Introduction

A single and dual date picker, written for angular 2+ projects.

Code Samples

Setup

import { DatePickerUtil, DatePickerConfig } from 'ct-ngx-datepicker';

...

class MyDatePickerConfig extends DatePickerConfig {
	
}

...

DatePickerUtil.forRoot(new MyDatePickerConfig())

Config is optional, more details to come on what options are configurable.

Usage Example

<ct-date-picker [(date)]="date1" zIndex="100" formControlName="singlePicker">
    <input #date class="form-control" />
</ct-date-picker>
<ct-dual-picker [(dateFrom)]="date2" [(dateTo)]="date3" zIndex="100" formControlName="dualPicker">
    <input #dateFrom class="form-control" />
    <input #dateTo class="form-control" />
 </ct-dual-picker>

Installation

npm install --save ct-ngx-datepicker    

Usage

Single datepicker

<ct-date-picker [(date)]="date1" zIndex="100" formControlName="singlePicker">
    <input #date class="form-control" />
</ct-date-picker>

Wrap a input field in the element. Mark the input field with #date

Single datepicker parameters

  • date - date model
  • dateChange - Event emitter for notification of date changes
  • zIndex - Allows specification of a custom z-index for the picker.
  • minDate - Minimum allowed date.
  • maxDate - Maximum allowed date.
  • match - Optional regex for properly parsing typed in dates, e.g. mm/dd/yyyy
  • globalMode - Sets the starting mode for selecting a date, e.g. Calendar, Year. If no value is specified, Calendar mode is implied.

Dual Date Picker

<ct-dual-picker [(dateFrom)]="date2" [(dateTo)]="date3" zIndex="100" formControlName="dualPicker">
    <input #dateFrom class="form-control" />
    <input #dateTo class="form-control" />
 </ct-dual-picker>

Wrap two input fields in the element. Mark each input #dateFrom and #dateTo respectively.

Dual datepicker parameters

  • dateFrom - date model
  • dateTo - date model
  • dateFromChange - Event emitter for notification of date changes
  • dateToChange - Event emitter for notification of date changes
  • zIndex - Allows specification of a custom z-index for the picker.
  • minDate - Minimum allowed date.
  • maxDate - Maximum allowed date.
  • match - Optional regex for properly parsing typed in dates, e.g. mm/dd/yyyy
  • globalMode - Sets the starting mode for selecting a date, e.g. Calendar, Year. If no value is specified, Calendar mode is implied.

Requirements

  • Angular 2+ (common, core, forms)
  • jQuery 3+ (see note below)
  • moment 2

Why jQuery?

I have already implemented the datepicker using the renderer class to support Angular Universal Apps, and avoid needing jQuery. However at this time renderer is experimental. When it is no longer experimental the code will be updated.

Why moment?

Because the datepicker returns a moment date, not a string.

Release Notes

  • 3.0.3 -- Fix bug with changeDate being called more than once
  • 3.0.0-3.0.2 -- Don't ask
  • 2.5.0 -- Ability to specify a minDate without a maxDate for validation
  • 2.4.0 -- Add ability to specify calendar default mode (globalMode), e.g. month/year.
  • 2.2.3 -- Remove sourcemap from dist build.
  • 2.2.2 -- Fixed bug where dates weren't invalid when cleared
  • 2.2.1 -- Fixed bug with validation on dual date picker.
  • 2.2.0 -- Added regex matching for date validation
  • 2.1.0 -- Added ability to validate dates on range, and moment.isValid
  • 2.0.0 -- Removed unused api parameters. Added basic validation for reactive forms.
  • 1.0.2 -- Notice about new repo.
  • 1.0.1 -- Unspecified bug fixes (sorry, just starting to do this right)
  • 1.0.0 -- Initial Release

Migration Notes

  • From 1.x to 2.x ..* Remove references to ctDisabled and inputClass from the datepickers. Instead apply those directly to the transcluded input.

Known Bug

  • When using an ISO date (yyyy-mm-dd), the day selected on the calendar picker ends uup being localized for your timezone.