Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
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.
en
and es
. Defaults to es
false
false
from
and to
setting all dates outside the range as disabled. Is any boundary is missing,
then it's taken as infinite.navigationState
state and disables
the navigation for the dates outside that range. If navigationState
is not provided, it defaults to available
form
or show
.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 { format, addDays, addYears, isBefore } from 'date-fns';
@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: Date) {
const isDisabled = this.state.has(date, STATES.DISABLED);
if (!isDisabled) {
const av = this.state.toggle(date, STATES.UNAVAILABLE);
if (av) {
this.date = format(date);
}
}
}
dates() {
const today = new Date();
toda.setHours(0, 0, 0, 0);
const aYear = addYears(today, 1);
let dates = [];
while(isBefore(today, aYear)) {
dates.push(new Date(today.getTime());
today = addDays(today, 1);
}
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
The npm package zmz-calendar receives a total of 0 weekly downloads. As such, zmz-calendar popularity was classified as not popular.
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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.