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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jackui-date-picker

v0.0.992

Published

This component is a highly customizable date and time picker for Angular applications. It allows users to select a date and, optionally, a time, with support for min/max dates, configurable minute steps, and flexible input/output formats.

Readme

Date Picker Component

This component is a highly customizable date and time picker for Angular applications. It allows users to select a date and, optionally, a time, with support for min/max dates, configurable minute steps, and flexible input/output formats.

Purpose

The app-date-picker component is designed to provide a user-friendly and flexible way to select dates and times. It can be easily integrated into Angular forms and supports both template-driven and reactive forms.

Dependencies

This component relies on the following third-party libraries:

  • date-fns: ^4.1.0 (for date manipulation and formatting)
  • class-variance-authority: ^0.7.1 (for creating reusable class variants)
  • clsx: ^2.1.1 (for conditionally constructing className strings)
  • tailwind-merge: ^3.3.1 (for merging Tailwind CSS classes)
  • tailwindcss: ^4.1.11 (a utility-first CSS framework)

Make sure these dependencies are installed in your project using your preferred package manager:

# npm
npm install date-fns class-variance-authority clsx tailwind-merge tailwindcss

# pnpm
pnpm add date-fns class-variance-authority clsx tailwind-merge tailwindcss

# yarn
yarn add date-fns class-variance-authority clsx tailwind-merge tailwindcss

For detailed instructions on how to set up Tailwind CSS with Angular, please refer to the official guide: Tailwind CSS Installation with Angular

Options

The component offers several options to customize its behavior:

| Input | Type | Default | Description | |----------------|--------------------------|---------|------------------------------------------------------------------------------------| | minDate | string \| null | null | The minimum selectable date in ISO 8601 format (e.g., '2024-01-01T00:00:00.000Z'). | | maxDate | string \| null | null | The maximum selectable date in ISO 8601 format (e.g., '2025-12-31T23:59:59.999Z'). | | minuteStep | 1 \| 5 \| 10 \| 15 \| 30 | 30 | The step for minute selection in the time picker. | | showTime | boolean | false | Whether to show the time selection inputs. |

Input and Output Formats

The component uses the ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ) for all data communication (input and output). This ensures consistency and compatibility with standard date formats.

  • Input: The component accepts a date in ISO 8601 format. You can provide this value through [(ngModel)] or a FormControl.
  • Output: The component emits the selected date in ISO 8601 format.

User Display Format

While the component uses ISO 8601 for data, the display format for the user is more human-readable and depends on the showTime option:

  • If [showTime]="true", the display format is dd/MM/yyyy HH:mm.
  • If [showTime]="false", the display format is dd/MM/yyyy.

Example Usage

Template-Driven Forms

// in your component.ts
import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  template: `
    <app-date-picker
      [(ngModel)]="selectedDate"
      [minDate]="'2024-01-01T00:00:00.000Z'"
      [maxDate]="'2025-12-31T23:59:59.999Z'"
      [minuteStep]="15"
    ></app-date-picker>
  `
})
export class AppComponent {
  selectedDate = '2024-01-23T15:15:00.000Z';
}

Reactive Forms

// in your component.ts
import { Component } from '@angular/core';
import { ReactiveFormsModule, FormGroup, FormControl } from '@angular/forms';

@Component({
  selector: 'app-root',
  template: `
    <form [formGroup]="form">
      <app-date-picker formControlName="date"></app-date-picker>
    </form>
  `,
  standalone: true,
  imports: [ReactiveFormsModule, DatePickerComponent] // Import DatePickerComponent if it's standalone
})
export class AppComponent {
  form = new FormGroup({
    date: new FormControl('2024-01-23T15:15:00.000Z')
  });
}