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

ngx-attendance-library

v1.0.13

Published

attendance calendar for angular apps (angular 8 recommended)

Downloads

38

Readme

NgxAttendanceCalendarLibrary

  • A simple calendar component to be used with Angular component.
  • This component enhances the funtionality of Angular attendance calendar component and is recommended that it is used with angular 6+ apps.
  • It is developed using Angular >=8.0.0 and its newly introduced ng g library schematics.
  • This library is generated with Angular CLI version 8.0.0.
  • Library location: projects/ngx-attendace-library directory of this repository.

Examples/Demo

  • stackblitz https://stackblitz.com/edit/ngx-attendance-library

Installation

npm i ngx-attendance-library --save

API

import { NgxAttendanceLibraryModule } from 'ngx-attendance-library'' selector: Ngx-AttendanceCalendar

@Inputs()

| Input | Type | Required | Description | | -------------- |:------:| --------:| --------------------------:| | monthData | string | YES | selected month | | yearData | string | YES | selected year | | attendanceData | object | YES | attendance data like below |

attendanceData example

[
    { 
      "year": "2020",
      "month": "apr",
      "data": [
          {
            "date": 1,
            "status": "present"
          },
          {
            "date": 2,
            "status": "abscent"
          },
          {
            "date": 3,
            "status": "present"
          },
          {
            "date": 4,
            "status": "woff"
          },
          {
            "date": 5,
            "status": "woff"
          },
          {
            "date": 6,
            "status": "present"
          },
          {
            "date": 7,
            "status": "present"
          },
          {
            "date": 8,
            "status": "present"
          },
          {
            "date": 9,
            "status": "present"
          },
          {
            "date": 10,
            "status": "present"
          },
          {
            "date": 11,
            "status": "woff"
          },
          {
            "date": 12,
            "status": "woff"
          },
          {
            "date": 13,
            "status": "req"
          }
        ] 
    }
  ]

Usage

  1. Register the NgxAttendanceLibraryModule in your app module.

import { NgxAttendanceLibraryModule } from 'ngx-attendance-library'

import { BrowserModule } from '@angular/platform-browser';
import { CommonModule } from '@angular/common';
import { NgxAttendanceLibraryModule } from 'ngx-attendance-library';

@NgModule({
 declarations: [...],
 imports: [
   BrowserModule,
   CommonModule,
   NgxAttendanceLibraryModule,
 ],
 providers: [],
 bootstrap: [...]
})
export class AppModule {}
  1. go to your component.
import { Component, OnInit } from '@angular/core';
@Component({
  selector: 'mat-ta-root',
  template: `
  <Ngx-AttendanceCalendar [monthData]="selectedMonth" [yearData]="selectedyear" [attendanceData]="myAttData"></Ngx-AttendanceCalendar>
`,
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
  // Paramteres for the input type are defined below. The url is generated using `json-server`.
  // Please run your own instance of the json-server to use the the below url.
  selectedMonth:string = "apr"
  selectedyear:string = "2020"
  myAttData = [
  { 
    "year": "2020",
    "month": "apr",
    "data": [
        {
          "date": 1,
          "status": "present"
        },
        {
          "date": 2,
          "status": "abscent"
        },
        {
          "date": 3,
          "status": "present"
        },
        {
          "date": 4,
          "status": "woff"
        },
        {
          "date": 5,
          "status": "woff"
        },
        {
          "date": 6,
          "status": "present"
        },
        {
          "date": 7,
          "status": "present"
        },
        {
          "date": 8,
          "status": "present"
        },
        {
          "date": 9,
          "status": "present"
        },
        {
          "date": 10,
          "status": "present"
        },
        {
          "date": 11,
          "status": "woff"
        },
        {
          "date": 12,
          "status": "woff"
        },
        {
          "date": 13,
          "status": "req"
        }
      ] 
  }
];


  constructor() {}



  ngOnInit() {
    
  }


}

Running the example in local env

  • npm i
  • Run ng serve for a dev server and running the demo app. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Build the NgxAttendanceLibrary module

Run ng build NgxAttendanceLibrary to build the library. The build artifacts will be stored in the dist/ngx-attendance-library directory. Use the --prod flag for a production build.

Running unit tests

Run ng test NgxAttendanceLibrary to execute the unit tests via Karma.

Credits

This project is based on Ngx-Attendance-Calendar. I want to thank entire Angular team for creating this awesome framework.