UNPKG

@syncfusion/ej2-schedule

Version:

Flexible scheduling library with more built-in features and enhanced customization options similar to outlook and google calendar, allowing the users to plan and manage their appointments with efficient data-binding support.

267 lines (266 loc) 9.56 kB
/** * Schedule common utilities */ export declare const WEEK_LENGTH: number; export declare const DEFAULT_WEEKS: number; export declare const MS_PER_DAY: number; export declare const MS_PER_MINUTE: number; /** * Method to get height from element * * @param {Element} container Accepts the DOM element * @param {string} elementClass Accepts the element class * @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element * @returns {number} Returns the height of the element */ export declare function getElementHeightFromClass(container: Element, elementClass: string, isTransformed?: boolean): number; /** * Method to get width from element * * @param {Element} container Accepts the DOM element * @param {string} elementClass Accepts the element class * @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element * @returns {number} Returns the width of the element */ export declare function getElementWidthFromClass(container: Element, elementClass: string, isTransformed?: boolean): number; /** * Method to get translateY value * * @param {HTMLElement | Element} element Accepts the DOM element * @returns {number} Returns the translateY value of given element */ export declare function getTranslateY(element: HTMLElement | Element): number; /** * Method to get translateX value * * @param {HTMLElement | Element} element Accepts the DOM element * @returns {number} Returns the translateX value of given element */ export declare function getTranslateX(element: HTMLElement | Element): number; /** * Method to get week first date * * @param {Date} date Accepts the date object * @param {number} firstDayOfWeek Accepts the first day of week number * @returns {Date} Returns the date object */ export declare function getWeekFirstDate(date: Date, firstDayOfWeek: number): Date; /** * Method to get week last date * * @param {Date} date Accepts the date object * @param {number} firstDayOfWeek Accepts the first day of week number * @returns {Date} Returns the date object */ export declare function getWeekLastDate(date: Date, firstDayOfWeek: number): Date; /** * Method to get first date of month * * @param {Date} date Accepts the date object * @returns {Date} Returns the date object */ export declare function firstDateOfMonth(date: Date): Date; /** * Method to get last date of month * * @param {Date} date Accepts the date object * @returns {Date} Returns the date object */ export declare function lastDateOfMonth(date: Date): Date; /** * Method to get week number * * @param {Date} date Accepts the date object * @returns {number} Returns the week number */ export declare function getWeekNumber(date: Date): number; /** * Method to get week middle date * * @param {Date} weekFirst Accepts the week first date object * @param {Date} weekLast Accepts the week last date object * @returns {Date} Returns the date object */ export declare function getWeekMiddleDate(weekFirst: Date, weekLast: Date): Date; /** * Method to set time to date object * * @param {Date} date Accepts the date object * @param {number} time Accepts the milliseconds * @returns {Date} Returns the date object */ export declare function setTime(date: Date, time: number): Date; /** * Method the reset hours in date object * * @param {Date} date Accepts the date object * @returns {Date} Returns the date object */ export declare function resetTime(date: Date): Date; /** * Method to get milliseconds from date object * * @param {Date} date Accepts the date object * @returns {number} Returns the milliseconds from date object */ export declare function getDateInMs(date: Date): number; /** * Method to get date count between two dates * * @param {Date} startDate Accepts the date object * @param {Date} endDate Accepts the date object * @returns {number} Returns the date count */ export declare function getDateCount(startDate: Date, endDate: Date): number; /** * Method to add no of days in date object * * @param {Date} date Accepts the date object * @param {number} noOfDays Accepts the number of days count * @returns {Date} Returns the date object */ export declare function addDays(date: Date, noOfDays: number): Date; /** * Method to add no of months in date object * * @param {Date} date Accepts the date object * @param {number} noOfMonths Accepts the number of month count * @returns {Date} Returns the date object */ export declare function addMonths(date: Date, noOfMonths: number): Date; /** * Method to add no of years in date object * * @param {Date} date Accepts the date object * @param {number} noOfYears Accepts the number of month count * @returns {Date} Returns the date object */ export declare function addYears(date: Date, noOfYears: number): Date; /** * Method to get start and end hours * * @param {Date} date Accepts the date object * @param {Date} startHour Accepts the start hour date object * @param {Date} endHour Accepts the end hour date object * @returns {Object} Returns the start and end hour date objects */ export declare function getStartEndHours(date: Date, startHour: Date, endHour: Date): Record<string, Date>; /** * Method to get month last date * * @param {Date} date Accepts the date object * @returns {number} Returns the month last date */ export declare function getMaxDays(date: Date): number; /** * Method to get days count between two dates * * @param {Date} startDate Accepts the date object * @param {Date} endDate Accepts the date object * @returns {number} Returns the days count */ export declare function getDaysCount(startDate: number, endDate: number): number; /** * Method to get date object from date string * * @param {string} date Accepts the date string * @returns {Date} Returns the date object */ export declare function getDateFromString(date: string): Date; /** * Method to get scrollbar width * * @returns {number} Returns the scrollbar width * @private */ export declare function getScrollBarWidth(): number; /** * Method to reset scrollbar width * * @private * @returns {void} */ export declare function resetScrollbarWidth(): void; /** * Method to find the index from data collection * * @param {Object} data Accepts the data as object * @param {string} field Accepts the field name * @param {string} value Accepts the value name * @param {Object} event Accepts the data as object * @param {Object[]} resourceCollection Accepts the data collections * @returns {number} Returns the index number */ export declare function findIndexInData(data: Record<string, any>[], field: string, value: string, event?: Record<string, any>, resourceCollection?: Record<string, any>[]): number; /** * Method to get element outer height * * @param {HTMLElement} element Accepts the DOM element * @returns {number} Returns the outer height of the given element */ export declare function getOuterHeight(element: HTMLElement): number; /** * Method to remove child elements * * @param {HTMLElement | Element} element Accepts the DOM element * @returns {void} */ export declare function removeChildren(element: HTMLElement | Element): void; /** * Method to check DST is present or not in date object * * @param {Date} date Accepts the date object * @returns {boolean} Returns the boolean value for either DST is present or not */ export declare function isDaylightSavingTime(date: Date): boolean; /** * Method to get UTC time value from date * * @param {Date} date Accepts the date * @returns {number} Returns the UTC time value */ export declare function getUniversalTime(date: Date): number; /** * Method to check the device * * @returns {boolean} Returns the boolean value for either device is present or not. */ export declare function isMobile(): boolean; /** * Method to check the IPad device * * @returns {boolean} Returns the boolean value for either IPad device is present or not. */ export declare function isIPadDevice(): boolean; /** * Method to capitalize the first word in string * * @param {string} inputString Accepts the string value * @param {string} type Accepts the string type * @returns {string} Returns the output string */ export declare function capitalizeFirstWord(inputString: string, type: string): string; /** * Method to get element cell width * * @param {HTMLElement} element Accepts the DOM element * @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element * @returns {number} Returns the width of the given element */ export declare function getElementWidth(element: HTMLElement, isTransformed?: boolean): number; /** * Method to get element cell Height * * @param {HTMLElement} element Accepts the DOM element * @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element * @returns {number} Returns the Height of the given element */ export declare function getElementHeight(element: HTMLElement, isTransformed?: boolean): number; /** * Method to get element cell Top * * @param {HTMLElement} element Accepts the DOM element * @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element * @returns {number} Returns the top value of the given element */ export declare function getElementTop(element: HTMLElement, isTransformed?: boolean): number;