angular-bootstrap-datetimepicker
Version:
Native Angular (8+) datetime picker component styled by Twitter Bootstrap 4.
191 lines (190 loc) • 8.92 kB
TypeScript
/**
* @license
* Copyright 2013-present Dale Lotts All Rights Reserved.
* http://www.dalelotts.com
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/dalelotts/angular-bootstrap-datetimepicker/blob/master/LICENSE
*/
import { SimpleChanges } from '@angular/core';
import { DlDateTimePickerModel } from './dl-date-time-picker-model';
import { DlModelProvider } from './dl-model-provider';
/**
* Default implementation for the `year` view.
*/
export declare class DlYearModelProvider implements DlModelProvider {
/**
* Create a moment at midnight january 1 at the start of the current decade.
* The start of the decade is always a year ending in zero.
*
* @param fromMilliseconds
* the moment in time from which the start of the decade will be determined.
* @returns
* moment at midnight january 1 at the start of the current decade.
* @internal
*/
private static getStartOfDecade;
/**
* Receives input changes detected by Angular.
*
* @param changes
* the input changes detected by Angular.
*/
onChanges(changes: SimpleChanges): void;
/**
* Returns the `year` model for the specified moment in `local` time with the
* `active` year set to January 1 of the specified year.
*
* The `year` model represents a decade (10 years) as two rows with five columns.
*
* The decade always starts on a year ending with zero.
*
* Each cell represents midnight January 1 of the indicated year.
*
* The `active` year will be the January 1 of year of the specified milliseconds.
*
* @param milliseconds
* the moment in time from which the year model will be created.
* @param selectedMilliseconds
* the current value of the date/time picker.
* @returns
* the model representing the specified moment in time.
*/
getModel(milliseconds: number, selectedMilliseconds: number): DlDateTimePickerModel;
/**
* Move the active `year` one row `down` from the specified moment in time.
*
* The `active` year will be the January 1 `five (5) years after` the specified milliseconds.
* This moves the `active` date one row `down` in the current `year` view.
*
* Moving `down` can result in the `active` year being part of a different decade than
* the specified `fromMilliseconds`, in this case the decade represented by the model
* will change to show the correct decade.
*
* @param fromMilliseconds
* the moment in time from which the next `year` model `down` will be constructed.
* @param selectedMilliseconds
* the current value of the date/time picker.
* @returns
* model containing an `active` `year` one row `down` from the specified moment in time.
*/
goDown(fromMilliseconds: number, selectedMilliseconds: number): DlDateTimePickerModel;
/**
* Move the active `year` one row `up` from the specified moment in time.
*
* The `active` year will be the January 1 `five (5) years before` the specified milliseconds.
* This moves the `active` date one row `up` in the current `year` view.
*
* Moving `up` can result in the `active` year being part of a different decade than
* the specified `fromMilliseconds`, in this case the decade represented by the model
* will change to show the correct decade.
*
* @param fromMilliseconds
* the moment in time from which the previous `year` model `up` will be constructed.
* @param selectedMilliseconds
* the current value of the date/time picker.
* @returns
* model containing an `active` `year` one row `up` from the specified moment in time.
*/
goUp(fromMilliseconds: number, selectedMilliseconds: number): DlDateTimePickerModel;
/**
* Move the `active` `year` one (1) year to the `left` of the specified moment in time.
*
* The `active` year will be the January 1 `one (1) year before` the specified milliseconds.
* This moves the `active` date one year `left` in the current `year` view.
*
* Moving `left` can result in the `active` year being part of a different decade than
* the specified `fromMilliseconds`, in this case the decade represented by the model
* will change to show the correct decade.
*
* @param fromMilliseconds
* the moment in time from which the `year` model to the `left` will be constructed.
* @param selectedMilliseconds
* the current value of the date/time picker.
* @returns
* model containing an `active` `year` one year to the `left` of the specified moment in time.
*/
goLeft(fromMilliseconds: number, selectedMilliseconds: number): DlDateTimePickerModel;
/**
* Move the `active` `year` one (1) year to the `right` of the specified moment in time.
*
* The `active` year will be the January 1 `one (1) year after` the specified milliseconds.
* This moves the `active` date one year `right` in the current `year` view.
*
* Moving `right` can result in the `active` year being part of a different decade than
* the specified `fromMilliseconds`, in this case the decade represented by the model
* will change to show the correct decade.
*
* @param fromMilliseconds
* the moment in time from which the `year` model to the `right` will be constructed.
* @param selectedMilliseconds
* the current value of the date/time picker.
* @returns
* model containing an `active` `year` one year to the `right` of the specified moment in time.
*/
goRight(fromMilliseconds: number, selectedMilliseconds: number): DlDateTimePickerModel;
/**
* Move the active `year` one decade `down` from the specified moment in time.
*
* The `active` year will be the January 1 `ten (10) years after` the specified milliseconds.
* This moves the `active` date one `page` `down` from the current `year` view.
*
* Paging `down` will result in the `active` year being part of a different decade than
* the specified `fromMilliseconds`. As a result, the decade represented by the model
* will change to show the correct decade.
*
* @param fromMilliseconds
* the moment in time from which the next `year` model page `down` will be constructed.
* @param selectedMilliseconds
* the current value of the date/time picker.
* @returns
* model containing an `active` `year` one decade `down` from the specified moment in time.
*/
pageDown(fromMilliseconds: number, selectedMilliseconds: number): DlDateTimePickerModel;
/**
* Move the active `year` one decade `up` from the specified moment in time.
*
* The `active` year will be the January 1 `ten (10) years before` the specified milliseconds.
* This moves the `active` date one `page-up` from the current `year` view.
*
* Paging `up` will result in the `active` year being part of a different decade than
* the specified `fromMilliseconds`. As a result, the decade represented by the model
* will change to show the correct decade.
*
* @param fromMilliseconds
* the moment in time from which the next `year` model page `up` will be constructed.
* @param selectedMilliseconds
* the current value of the date/time picker.
* @returns
* model containing an `active` `year` one decade `up` from the specified moment in time.
*/
pageUp(fromMilliseconds: number, selectedMilliseconds: number): DlDateTimePickerModel;
/**
* Move the `active` `year` to the `last` year in the decade.
*
* The view or time range will not change unless the `fromMilliseconds` value
* is in a different decade than the displayed decade.
*
* @param fromMilliseconds
* the moment in time from which the `last` active `year` will be calculated.
* @param selectedMilliseconds
* the current value of the date/time picker.
* @returns
* a model with the `last` cell in the view as the active `year`.
*/
goEnd(fromMilliseconds: number, selectedMilliseconds: number): DlDateTimePickerModel;
/**
* Move the `active` `year` to the `first` year in the decade.
*
* The view or time range will not change unless the `fromMilliseconds` value
* is in a different decade than the displayed decade.
*
* @param fromMilliseconds
* the moment in time from which the `first` active `year` will be calculated.
* @param selectedMilliseconds
* the current value of the date/time picker.
* @returns
* a model with the `first` cell in the view as the active `year`.
*/
goHome(fromMilliseconds: number, selectedMilliseconds: number): DlDateTimePickerModel;
}