1.0.2 • Published 6 months ago

bibliolib-datetime-picker v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Bibliolib-Datetime-picker

Simple datetime picker for angular apps.

Installation

npm install bibliolib-datetime-picker

Usage

Import the component:

import { BibliolibDatetimePickerComponent } from "bibliolib-datetime-picker";

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [BibliolibDatetimePickerComponent],
  templateUrl: './app.component.html',
  styleUrl: './app.component.scss'
})

Use the component in your app:

<bibliolib-datetime-picker [startHours]="startHour" [endHours]="endHours" [stepHours]="stepHours" [currentDate]="dateSignal" (dateChange)="onValueChange($event)" />
import { Component } from "@angular/core";

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.scss"],
})
export class AppComponent {
  // Start hour of the hourpicker
  startHour: number = 8;
  // End hour of the hourpicker
  endHours: number = 20;
  // Step hour of the hourpicker
  stepHours: number = 30;
  // Signal to patch the datepicker value from the parent component
  dateSignal: WritableSignal<DateTime> = signal<DateTime>({ date: "", hour: "" });

  constructor() {}

  onValueChange(value: DateTime) {
    console.log(value);
  }

  patchDateTimePickerValue() {
    this.dateSignal.set({ date: "2021-01-01", hour: "12:00" });
  }
}

License

MIT

Author

github: @reyvaxreecded

1.0.2

6 months ago

1.0.1

1 year ago

1.0.0

1 year ago

0.3.0

1 year ago

0.3.1

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago