import "../../libs/mobiscroll/js/mobiscroll.jquery.min"; import { MbscCalendarOptions, Calendar as MbscCalendar } from "../../libs/mobiscroll/js/mobiscroll.jquery.min"; import { CleaveOptions } from "cleave.js/options"; /** * Datepicker module options */ export interface ICalendarModuleOptions { /** * Date format to when a date is picked */ dateFormat?: string; /** * Time format to when a date is picked */ timeFormat?: string; /** * Localization "da" is default, use "en" for english version */ lang?: string; /** * This event is triggered when a date is selected */ onSetDate?: (event: any, inst: any) => void; /** * This event is triggered when a Set button is clicked */ onSet?: (event: any, inst: any) => void; /** * This event is triggered when the datepicker is initialized */ onInit?: (event: any, inst: any) => void; /** * Min date for datepicker */ min?: Date; /** * Max date for datepicker */ max?: Date; /** * The type of the datetimepicker (Date, Time or Date and time). Default value is "Date". */ type?: DatetimePickerTypeEnum; /** * If true, the scroll wheels are circular. */ circular?: boolean | boolean[]; /** * If true clear button is visible. Default value is "false". */ allowClear?: boolean; /** * This setting makes it posible for the user to type value into the input field, otherwise input field is readonly. Is allowed by default. */ allowTyping?: AllowTypingOptions | false; /** * Suppress the warning when the datetimepicker is initialized on multiple elements */ suppressMultipleElementsWarning?: boolean; /** * Optional: Override additional mobiscroll settings. Does not override datepicker settings defined in ICalendarModuleOptions. */ additionalMbscCalenderOptions?: MbscCalendarOptions; } export declare enum DatetimePickerTypeEnum { Time = 1, Date = 2, DateAndTime = 3 } interface AllowTypingOptions { /** * Options: Whether typing in date fields are allowed. Default value is "true". */ enabled?: boolean; /** * Optional: If true the datetimepicker will when the input is clicked. Default value is "true". */ openOnInputClicked?: boolean; /** * Optional: If true the datetimepicker will open when the icon is clicked. Default value is "true". */ openOnIconClicked?: boolean; /** * Optional: If true the datetimepicker will open when space or enter keys are pressed. Default value is "true". */ openOnKeypress?: boolean; /** * Optional: Override Cleaveoptions for field if custom format is needed, module only supports "/" or "-" as delimeter between day, month and year */ overrideCleaveOptions?: CleaveOptions; } export default class DatetimePickerModule { private $element; private mobiscrollInstance; private readonly moduleInitKey; /** * Init the datepicker * @param selector Selector or HTML element for the datepicker you want to initialize * @param options Options for the datepicker */ constructor(selector: string | HTMLElement, options?: ICalendarModuleOptions); /** * Get DOM elements, which the datetimepicker was initialized on */ getDomElements(): JQuery; /** * Get the underlying mobiscroll instance, which the datetimepicker uses */ getMobiscrollInstance(): MbscCalendar; /** * Set the value of the datetimepicker * @param value Value to set as a Date object * @param triggerChange If setValue should trigger a DOM change event on the datetimepicker input */ setValue(value: Date, triggerChange?: boolean): void; /** * Gets the value as a Date object */ getValue(): Date; /** * Gets the temporary value as a Date object. The temporary value is the value prior to clicking the Set button. */ getTempValue(): Date; private initCalendarModule; private getCleaveObjectBasedOnOptions; private getCleaveDateObjectBasedOnFormat; private getCleaveDateTimeYearObjectBasedOnFormat; private getTimeDelimiter; } export {};