0.3.1 • Published 1 month ago

bibliolib-datetime-picker v0.3.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month 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

0.3.0

1 month ago

0.3.1

1 month ago

0.2.1

3 months ago

0.2.0

3 months ago

0.1.3

4 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago

0.0.9

6 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago