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

@danielzach/ng-mat-datetimepicker

v1.0.3

Published

Angular Material Datetimepicker

Downloads

6

Readme

Material DatePicker by @https://github.com/danielzach/ng-mat-datetimepicker

Fork of the official Material Datepicker for Angular v6 with timepicker support.

The datepicker allows users to enter a date either through text input, or by choosing a date from the calendar.
It is made up of several components and directives that work together.

Further documentation can be found at the official docs: https://material.angular.io/components/datepicker/overview

<mat-form-field>
  <input matInput [matDatepicker]="picker" placeholder="Choose a date">
  <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
  <mat-datepicker #picker></mat-datepicker>
</mat-form-field>

The mat-datepicker has the following input parameters:

  • startAt: start Date/Moment, otherwise the current selected value
  • type: date | datetime | time output type and available views. default: date
  • startView: clock | month | year | years initial view to load. default: month
  • clockStep: interval to use in the clock view. default: 1
  • twelveHour: whether to use 12 or 24 hrs format. default: false
  • touchUi: calendar UI mode. default: true (recommended)
  • disabled: whether the datepicker pop-up should be disabled
  • matDatepicker: whether the datepicker is connected to a date type one

and the input[matDatepicker] has the output:

  • dateChange: Emits when a change event is fired on this <input>.
  • dateInput: Emits when a input event is fired on this <input>.

Installation

As usual run yarn add @https://github.com/danielzach/ng-mat-datetimepicker or npm install @https://github.com/danielzach/ng-mat-datetimepicker.
This module requires moment and moment-timezone for the MomentDateAdapter.

Now add the modules to your Angular Module:

import { MatDatepickerModule, MatMomentDateModule } from '@https://github.com/danielzach/ng-mat-datetimepicker';

@NgModule({
  imports: [
    MatDatepickerModule,
    MatMomentDateModule,
    ...
  ],
  ...
})
export class AppModule {}

Note that the MatDatepickerModule can be loaded into feature modules,
but it requires the providers given by MatMomentDateModule,
so it's recommended to be imported in your root Module.

Styling

This module supports the Angular Material prebuilt themes that can be included in angular.json:

"styles": [
  "node_modules/@https://github.com/danielzach/ng-mat-datetimepicker/prebuilt-themes/indigo-pink.css",
  ...
],

available themes are deeppurple-amber, indigo-pink, pink-bluegrey and purple-green.

You can use your customized Material Theme as usual:

@import '~@https://github.com/danielzach/ng-mat-datetimepicker/theming';

@include mat-datepicker-theme($theme);

Also, the primary color can be customized with CSS variables. The required ones are:

body {
  --bg-dialog: white;
  --primary: rgba(73, 200, 242, 1);
  --primary-contrast: #fff;
  --primary-a60: rgba(73, 200, 242, 0.6);
  --primary-a80: rgba(73, 200, 242, 0.8);
}

Date Formats Customization

This fork uses an extended set of DateFormats,
so please check this file if you're building your own.

Usage Examples

DateTime picker (year, month, date and clock views)

<mat-datepicker type="datetime" clockStep="5" #pickerStart></mat-datepicker>

DateTime picker (starting on the clock view)

<mat-datepicker type="datetime" startView="clock" #startPicker></mat-datepicker>

Time picker (clock views, with 5 minutes jump)

<mat-datepicker type="time" clockStep="5" #timeStart></mat-datepicker>

Enjoy!