![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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
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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.