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

@angular-date-components/scheduler

v0.0.3

Published

[![License](https://img.shields.io/badge/License-MIT-yellow.svg)]

Downloads

7

Readme

UniversalComponents

[License]

related-links

files: https://github.com/SirAlfred0/ADC_Files demo: http://m-asadi-testing.iapp.ir/ docs: soon...

Description

Angular Date Components is a comprehensive angular library of date-related components designed to meet the needs of applications that require localization based on various calendar systems. While the package currently includes a powerful scheduler component tailored for the Jalali calendar, Gregorian calendar, etc.., our roadmap includes plans to introduce additional components as well. With Universal Components, developers can seamlessly integrate and display calendar-related functionalities in their applications, ensuring they align with the cultural and regional requirements of users following different calendar systems.

Installation

To install Package, simply run:

npm i angular-date-components/scheduler

usage

in app.module.ts or your standalone component:

import { ADCSchedulerModule } from '@angular-date-components/scheduler';

 imports: [
    ...
    ADCSchedulerModule,
  ],

then you need to provide some dependecty to make scheduler work based on your region and calendar type.

in app.module.ts or your standalone component:

import { ADC_DATE_ADAPTER, ADC_DATE_FORMATTER } from '@angular-date-components/scheduler';
  providers: [
    {
      provide: ADC_DATE_ADAPTER,
	    useClass: new DateAdapterPersian()
    },
    {
      provide: ADC_DATE_FORMATTER,
	    useClass new DateFormatterPersian()
    },
  ]

DateAdapterPersian() and DateFormatterPersian() are two classes that implement ADCIDateAdapter and ADCIDateFormatter you can find the sample in file repository (related-links > files) and customize those based on your needs.

you still need to provide one more dependency to make ADCScheduler work and that is options. I've provided an option class for you to make some changes in the direction or initial view of the component here is an implemention of that class

import { ADCIOptions } from "@angular-date-components/scheduler";


export class SchedulerOptionsPersian implements ADCIOptions
{
// always set this to true this me be deprecated in the future version
    private _considerTime: boolean = true;
    private _direction: 'rtl' | 'ltr' = 'rtl';
    private _initialView: "month" | "week" | "day" = "month";


    get considerTime(): boolean {
        return this._considerTime;
    }
    
    set considerTime(value: boolean)
    {
        this._considerTime = value;
    }

    get direction(): "ltr" | "rtl" {
        return this._direction
    }
}

to provide this class, in app.module.ts or your stanalone component add

  import { ADC_OPTIONS } from '@angular-date-components/scheduler';


  providers: [
    {
      provide: ADC_OPTIONS,
      useValue: new SchedulerOptionsPersian()
    }
  ]

and finally just use the scheduler in your template like this

<adc-scheduler 
	(EventClick)="onEventClick($event)"
	(DateSelect)="onDateSelect($event)"
	[Weekends]="[5,6]" [Holidays]="['2023-12-09', '2023-12-10']"  
	(DateChange)="onDateChange($event)" 
	(Next)="onNext()" 
	(Previous)="onPrevius()" 
	(ViewChange)="onViewChange($event)"
>
</adc-scheduler>
import { ADCEventsSource } from '@angular-date-components/scheduler';


export class SchedulerComponent {

// use this to set calendar events in the calendar
  @ViewChild(ADCEventsSource) adcEventsSource: ADCEventsSource = {} as ADCEventsSource;

  constructor(
    private eventService: EventsService
  )
  {

  }

  onDateChange(date: any): void
  {
     //you can provide some action if user changes date range for example load your calendar events for server

    this.loadEvents();
  }

  onNext(): void
  {
     //you can provide some action if user clicks on next button
  }

  onPrevius(): void
  {
     //you can provide some action if user clicks on previous button
  }

  onViewChange(view: string): void
  {
     // you can provide some actions if user changes the view
  }

  onEventClick(event: any): void
  {
     //implement event click
  }

  onDateSelect(event: any): void
  {
     //implement date selection
  }

  private loadEvents(): void
  {
    this.eventService.list().subscribe({
      next: (res: ADCIEvent[]) =>
      {
        this.adcEventsSource.events = res;
      },
    })
  }
}

also you need to import styles from @angular-date-componets/scheduler/assets/style.css

you can do it by importing styles into angular.json file

  "styles": [
    ...
    "node_modules/@angular-date-components/scheduler/assets/styles.css",
    "src/styles.css"
  ],

if you want to localize scheduler component based on your language use this as an example

in app.module.ts or your standalone component

import { ADCILabels, ADC_LABELS } from '@angular-date-components/scheduler';

function adcLabels(): ADCILabels
{
  const fa_labels: ADCILabels = {
    day: 'روز',
    month: 'ماه',
    today: 'امروز',
    week: 'هفته',
    year: 'سال'
  };

  return fa_labels;
}


  providers: [
     ...
    {
      provide: ADC_LABELS,
      useFactory: adcLabels,
    },
  ]