All Projects → h2qutc → ngx-mat-datetime-picker

h2qutc / ngx-mat-datetime-picker

Licence: MIT License
⛔️ DEPRECATED This is no longer supported, please consider using the repository @angular-material-components/datetime-picker(https://github.com/h2qutc/angular-material-components) instead.

Programming Languages

typescript
32286 projects
HTML
75241 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ngx-mat-datetime-picker

contentstats
DEPRECATED – See how many entries have been created for channels and structures in your Craft CMS website.
Stars: ✭ 29 (+0%)
Mutual labels:  deprecated, obselete
react-virtual-keyboard
Use jQuery Virtual Keyboard in react.js
Stars: ✭ 44 (+51.72%)
Mutual labels:  deprecated, obselete
picosdk-python-examples
DEPRECATED - An example Python application and examples for PicoScope® oscilloscope products.
Stars: ✭ 21 (-27.59%)
Mutual labels:  deprecated, obselete
OSM-Completionist
⛔️ DEPRECATED iOS companion app for OpenStreetMap that allows contributors to complete missing information
Stars: ✭ 17 (-41.38%)
Mutual labels:  deprecated, obselete
broccoli-traceur
Traceur is a JavaScript.next to JavaScript-of-today compiler
Stars: ✭ 29 (+0%)
Mutual labels:  deprecated
jog arm
A real-time robot arm jogger.
Stars: ✭ 39 (+34.48%)
Mutual labels:  deprecated
is-safe-integer
ES2015 Number.isSafeInteger() ponyfill
Stars: ✭ 16 (-44.83%)
Mutual labels:  deprecated
AASecondaryScreen
[Deprecated] · Approachable implementation of iOS AirPlay-Mirroring using Swift.
Stars: ✭ 40 (+37.93%)
Mutual labels:  deprecated
Liquid-Application-Framework-1.0-deprecated
Liquid is a framework to speed up the development of microservices
Stars: ✭ 26 (-10.34%)
Mutual labels:  deprecated
aldryn-bootstrap3
DEPRECATED, this project is no longer maintained, see README for more information.
Stars: ✭ 44 (+51.72%)
Mutual labels:  deprecated
HAN-pytorch
(Deprecated) Hierarchical Attention Networks for Document Classification (https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf) - in Pytorch
Stars: ✭ 39 (+34.48%)
Mutual labels:  deprecated
apiblueprintorg
old apiblueprint.org site
Stars: ✭ 19 (-34.48%)
Mutual labels:  deprecated
keyple-java
Eclipse Keyple™ Project: deprecated repository embedding all components of the Java implementation until version 1.0.0
Stars: ✭ 17 (-41.38%)
Mutual labels:  deprecated
steam
DEPRECATED Build, manage and deploy H2O's high-speed machine learning models.
Stars: ✭ 59 (+103.45%)
Mutual labels:  deprecated
Drupal-Scaffold
DEPRECATED: This project has been replaced by documentation within Confluence regarding best practices for setting up a new Drupal 9 project.
Stars: ✭ 48 (+65.52%)
Mutual labels:  deprecated
angular-karma test-explorer
vscode extension for easy angular testing and debugging
Stars: ✭ 67 (+131.03%)
Mutual labels:  deprecated
cleverbot
Deprecated/unmaintained. See https://www.cleverbot.com/api/
Stars: ✭ 23 (-20.69%)
Mutual labels:  deprecated
python-poster
DEPRECATED Streaming HTTP uploads and multipart/form-data encoding
Stars: ✭ 16 (-44.83%)
Mutual labels:  deprecated
Kwicks
⛔ Kwicks for jQuery - fork of jQuery Kwicks by Jeremy Martin
Stars: ✭ 50 (+72.41%)
Mutual labels:  deprecated
react-native-apple-sign-in
Apple Signin for your React Native applications
Stars: ✭ 16 (-44.83%)
Mutual labels:  deprecated

⛔️ DEPRECATED

This is no longer supported, please consider using the repository angular-material-components/datetime-picker instead.

Ngx Material DatetimePicker, Timepicker for @angular/material 7.x, 8.x, 9.x

Build Status codecov License npm version

Description

A DatetimePicker like @angular/material Datepicker by adding support for choosing time.

button

DEMO

@see LIVE DEMO

Alt Text

Getting started

Angular 7.x, 8.x: Install the version v2.x

npm install --save [email protected]

@see DEMO stackblitz for Angular 7, Angular 8

Angular 9.x: Install the version v3.x

npm install --save [email protected]

@see DEMO stackblitz for Angular 9

Setup

Basically the same way the @angular/material Datepicker is configured and imported.

import { NgxMatDatetimePickerModule, NgxMatTimepickerModule } from 'ngx-mat-datetime-picker';
@NgModule({
   ...
   imports: [
      BrowserModule,
      HttpClientModule,
      BrowserAnimationsModule,
      MatDatepickerModule,
      MatInputModule,
      NgxMatTimepickerModule,
      FormsModule,
      ReactiveFormsModule,
      MatButtonModule,
      NgxMatDatetimePickerModule,
   ],
   ...
})
export class AppModule { }

@see src/app/app.module.ts

Using the component

The same API as @angular/material Datepicker (@see API docs)

Datetime Picker (ngx-mat-datetime-picker)

<mat-form-field>
   <input matInput [ngxMatDatetimePicker]="picker" placeholder="Choose a date" [formControl]="dateControl"
      [min]="minDate" [max]="maxDate" [disabled]="disabled">
   <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
   <ngx-mat-datetime-picker #picker [showSpinners]="showSpinners" [showSeconds]="showSeconds"
      [stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond">
   </ngx-mat-datetime-picker>
</mat-form-field>

Timepicker (ngx-mat-timepicker)

<ngx-mat-timepicker [(ngModel)]="date"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [disabled]="disabled"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [stepHour]="2" [stepMinute]="5" [stepSecond]="10"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [showSpinners]="showSpinners"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [showSeconds]="showSeconds"></ngx-mat-timepicker>
<ngx-mat-timepicker [formControl]="formControl"></ngx-mat-timepicker>

List of @Input

@Input Type Default value Description
disabled boolean null If true, the picker is readonly and can't be modified
showSpinners boolean true If true, the spinners above and below input are visible
showSeconds boolean true If true, it is not possible to select seconds
stepHour number 1 The number of hours to add/substract when clicking hour spinners
stepMinute number 1 The number of minutes to add/substract when clicking minute spinners
stepSecond number 1 The number of seconds to add/substract when clicking second spinners
color ThemePalette undefined Color palette to use on the datepicker's calendar.
enableMeridian boolean false Whether to display 12H or 24H mode.
touchUi boolean false Whether the calendar UI is in touch mode. In touch mode the calendar opens in a dialog rather than a popup and elements have more padding to allow for bigger touch targets.

Choosing a date implementation and date format settings

The datepicker was built to be date implementation agnostic. This means that it can be made to work with a variety of different date implementations. However it also means that developers need to make sure to provide the appropriate pieces for the datepicker to work with their chosen implementation.

The easiest way to ensure this is to import one of the provided date modules:

NgxMatNativeDateModule NgxMatMomentModule
Date type Date Moment
Supported locales en-US See project for details
Dependencies None Moment.js
Import from ngx-mat-datetime-picker ngx-mat-moment-adapter

To use NgxMatMomentModule:

npm install --save ngx-mat-moment-adapter

Please note: NgxMatNativeDateModule is based off the functionality available in JavaScript's native Date object. Thus it is not suitable for many locales. One of the biggest shortcomings of the native Date object is the inability to set the parse format.

We highly recommend using the NgxMatMomentModule or a custom NgxMatDateAdapter that works with the formatting/parsing library of your choice.

For example:

Creating a custom date adapter:

@Injectable()
export class CustomDateAdapter extends NgxMatDateAdapter<D> {...}
// D can be Date, Moment or customized type

Creating a custom date adapter module

@NgModule({
  providers: [
    {
      provide: NgxMatDateAdapter,
      useClass: CustomDateAdapter,
      deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]
    }
  ],
})
export class CustomDateModule { }

Theming

<link href="https://fonts.googleapis.com/icon?family=Material+Icons&display=block" rel="stylesheet">

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].