npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pm-ion-calendar

v1.1.1

Published

Il s'agit d'un module modifiable à inclure directement dans src/app :

Downloads

3

Readme

PM-CALENDAR

Il s'agit d'un module modifiable à inclure directement dans src/app :

Installation

  • npm install pm-calendar
  • Déplacer le dossier ./nodes_modules/pm-calendar dans ./src/app
  • Charger PmCalendarModule dans les imports de app.module.ts :
import { PmCalendarModule } from './pm-calendar/pm-calendar.module';
//...
//...
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    PmCalendarModule //Charger le module ici
  ],
  providers: [],
  bootstrap: [AppComponent]
})

Utilisation

Template html

Le modèle du composant est le suivant :

<app-calendar [datestart]="datestart" [dateend]="dateend" ></app-calendar>

Paramètres :

  • datestart: Date - La date du premier mois à afficher
  • dateend: Date - La date du dernier mois à afficher
  • lang: string (Optionnel) - La langue du calendrier à afficher ( Par default: "fr" )
Langues :

La liste des langue est disponible et modifiable dans ./class/CalendarLangs.ts ainsi que la langue par default ( DEFAULT_LANG )

Component ts

On peut utiliser le service CalendarService pour accéder aux événements relatif au calendrier :

import { CalendarService } from './pm-calendar/services/calendar.service';
//...
//...
constructor( private calendarService: CalendarService ){ //...

Evénements disponibles :

  • onDateSelected(): void
import { CalendarService } from './pm-calendar/services/calendar.service';
import { DayCalendar } from './pm-calendar/class/DayCalendar';
//...
//...
constructor( private calendarService: CalendarService ){
	this.calendarService.onDateSelected( ( day: DayCalendar ) => {
	    console.log( day );
	});
}

La classe retournée ( DayCalendar ) possède les méthodes suivantes :

  • getClasses(): string[]
  • setClasses( classes: string[] ): void
  • addClass(): void
  • removeClass(): void
  • getObjDate(): Date
  • getWeekNumber(): number
day.addClass("test"); //Ajoute la classe test à la case de la date
day.removeClass("test"); //Retire la classe test de la case de la date
day.getObjDate(); //Renvoie l'objet Date correspondant
day.getWeekNumber(); //Renvoie l'index de la semaine correspondant à ce jour dans le mois
day.getClasses(); //Renvoie la liste des classes présente sur la case
day.setClasses(["test", "disabled"]); //Définit la liste des classes de la case

Quitter le composant

Retirer les événements liés au service :

export class AppComponent implements OnDestroy {
//...
//...
ngOnDestroy(){
	this.calendarService.clearEvents();
}

Styles

Tout les styles sont modifiable :

  • ./calendar/component.calendar.css
  • ./calendar/component.week.css
  • ./calendar/component.day.css //Contient le css des classes utilisées avec day.addClass / day.removeCass ...ect.

Attention cependant certains css ont été pensé pour garder l'aspect "tableau" du calendrier :

/* Aspect 'tableau' du calendrier */
.dhead {
    display: flex;
}
.dhcol {
    width: 100px;
}
.drow {
    display: flex;
}
.dcol {
    width: 100px;
}
/* jours désactivés */
.dcol.disabled {
    background-color: grey;
}