24 lines
1.2 KiB
TypeScript
24 lines
1.2 KiB
TypeScript
|
/**
|
||
|
* Returns a date offset from the given date by the specified number of minutes.
|
||
|
* @param date - The origin date
|
||
|
* @param minutes - The number of minutes to offset. 'minutes' can be negative.
|
||
|
* @returns A new Date object offset from the origin date by the given number of minutes
|
||
|
*/
|
||
|
export declare const addMinutes: (date: Date, minutes: number) => Date;
|
||
|
/**
|
||
|
* Rounds the date's minute up to the next available increment. For example, if `date` has time 1:21
|
||
|
* and `increments` is 5, the resulting time will be 1:25.
|
||
|
* @param date - Date to ceil minutes
|
||
|
* @param increments - Time increments
|
||
|
* @returns Date with ceiled minute
|
||
|
*/
|
||
|
export declare const ceilMinuteToIncrement: (date: Date, increments: number) => Date;
|
||
|
/**
|
||
|
* Returns a date object from the selected time.
|
||
|
* @param useHour12 - If the time picker uses 12 or 24 hour formatting
|
||
|
* @param dateStartAnchor - The baseline date to calculate the offset of the selected time
|
||
|
* @param selectedTime - A string representing the user selected time
|
||
|
* @returns A new date object offset from the baseDate using the selected time.
|
||
|
*/
|
||
|
export declare const getDateFromTimeSelection: (useHour12: boolean, dateStartAnchor: Date, selectedTime: string) => Date;
|