Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
@angular/material-moment-adapter
Advanced tools
@angular/material-moment-adapter is an Angular package that provides a Moment.js adapter for Angular Material's datepicker. It allows you to use Moment.js to parse, format, and manipulate dates within Angular Material components.
Date Adapter Configuration
This code demonstrates how to configure the Moment.js date adapter in an Angular module. It imports the necessary modules and sets the adapter options to use UTC.
import { NgModule } from '@angular/core';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatMomentDateModule, MAT_MOMENT_DATE_ADAPTER_OPTIONS } from '@angular/material-moment-adapter';
@NgModule({
imports: [
MatDatepickerModule,
MatMomentDateModule
],
providers: [
{ provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: true } }
]
})
export class AppModule { }
Using Moment.js with Angular Material Datepicker
This code shows how to use Moment.js with Angular Material's datepicker component. It initializes a date using Moment.js and binds it to the datepicker input.
import { Component } from '@angular/core';
import * as moment from 'moment';
@Component({
selector: 'app-datepicker',
template: '<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>'
})
export class DatepickerComponent {
selectedDate = moment();
}
@angular/material-luxon-adapter provides a Luxon adapter for Angular Material's datepicker. Luxon is a modern JavaScript date library that offers a more comprehensive and immutable API compared to Moment.js. It is a good alternative if you prefer using Luxon over Moment.js.
@angular/material-date-fns-adapter provides a date-fns adapter for Angular Material's datepicker. date-fns is a lightweight and modular date library that allows you to import only the functions you need. It is a good alternative if you are looking for a smaller bundle size and tree-shakable date library.
The sources for this package are in the main Angular Material repo. Please file issues and pull requests against that repo.
License: MIT
19.0.5 "silk-sky" (2025-01-08)
| Commit | Type | Description | | -- | -- | -- | | 64d8df8bd | fix | menu: avoid re-opening the menu on enter (#30263) | | 5b04e1733 | fix | tree: expandAll not expanding all nodes (#30226) |
| Commit | Type | Description | | -- | -- | -- | | 85c6e54a5 | fix | datepicker: simplify DI setup (#30247) | | 1eb6cabcc | fix | sidenav: remove deprecated API usage (#30268) | | 4618b5b7c | fix | sidenav: switch away from animations module (#30235) | | 10e752a52 | fix | sort: show arrow on focus (#30217) | | e8a099179 | fix | timepicker: don't mark as touched when blurred while dropdown is open (#30228) | | f9f8df348 | perf | tooltip: Tiny but measurable optimization to MatTooltip construction. Defer hooking up to directionality changes until overlay is created. (#30214) |
| Commit | Type | Description | | -- | -- | -- | | 4a040cb9f | perf | column-resize: Use ResizeObserver to avoid layout thrashing (#30215) |
<!-- CHANGELOG SPLIT MARKER --><a name="19.1.0-next.3"></a>
FAQs
Angular Material Moment Adapter
The npm package @angular/material-moment-adapter receives a total of 360,853 weekly downloads. As such, @angular/material-moment-adapter popularity was classified as popular.
We found that @angular/material-moment-adapter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.