![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
zmz-calendar
Advanced tools
angular responsive calendar/datepicker
For packages version, please refer to package.json
Simply install from npm
npm install --save zmz-calendar
and add ZomoZ font to your project: Copy the fonts from src/assets/fonts/icons/zomoz-font.*
to your project assets and create the font face
@font-face {
font-family: 'ZomoZ';
src: url('/path/to/font/zomoz-font.eot');
src: url('/path/to/font/zomoz-font.eot?#iefix') format('embedded-opentype'),
url('/path/to/font/zomoz-font.woff') format('woff'),
url('/path/to/font/zomoz-font.ttf') format('truetype'),
url('/path/to/font/zomoz-font.svg#ZomoZ') format('svg');
font-weight: normal;
font-style: normal;
}
If you don't include this font, some icons won't display right and the name must be the same.
The library is componsed by two elemnts: The calendar component and the calendar state to control it. The component uses the state but it doesn't modify it
zmz-calendar
This component holds all the calendar logic. It's intend to be a dumb component who just emits click events.
es
false
false
CalendarState
This is the state the library user should modify to change the calendar. It tags a set of dates with different states so they're displayed according to them
You can use them importing STATES
from the library: import { STATES } from 'zmz-calendar'
.
You should instantiate a CalendarState
and use its api to modify it
app.component.ts
import { Component } from '@angular/core';
import { CalendarState, State, STATES } from 'zmz-calendar';
import * as moment from 'moment';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
date: string;
state: CalendarState;
config = { locale: 'es', weekDayClickable: false };
constructor() {
const dates = this.dates();
this.state = new CalendarState(dates, STATES.AVAILABLE);
}
onDateSelected(date: moment.Moment) {
const isDisabled = this.state.has(date, STATES.DISABLED);
if (!isDisabled) {
const av = this.state.toggle(date, STATES.UNAVAILABLE);
if (av) {
this.date = date.format();
}
}
}
dates() {
const today = moment();
const aYear = moment().add(1, 'year');
let dates = [];
while(today.isBefore(aYear)) {
dates.push(today.clone());
today.add(1, 'day');
}
return dates;
}
}
app.component.html
<div style="max-width: 500px; width: 100%">
<zmz-calendar [state]="state" [config]="config" (dateSelected)="onDateSelected($event)">
<div class="prev btn">
<i class="fa fa-arrow-left" aria-hidden="true"></i>
</div>
<div class="next btn">
<i class="fa fa-arrow-right" aria-hidden="true"></i>
</div>
</zmz-calendar>
</div>
{{ date }}
Using npm
npm test
TDD
gulp watch
to build the project and start watching file changesnpm link
in the root of the projectdemo
project and run npm link zmz-calendar
and npm install
demo
project and run npm start
FAQs
angular2 responsive calendar
We found that zmz-calendar demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.