import { TimeOfDay, TimeOfDayRange, EntitiesDayOfWeek as DayOfWeek } from '@wix/auto_sdk_restaurants_fulfillment-methods'; export { TimeOfDay, TimeOfDayRange, DayOfWeek }; /** * Get the current locale * Uses the configured locale, falls back to i18n.getLocale() * * @returns The current locale string */ export declare const getLocale: () => string; /** * Get the current timezone * Uses the configured timezone, falls back to undefined (browser default) * * @returns The current timezone string or undefined */ export declare const getTimezone: () => string | undefined; /** * Mapping of day of week enum to numeric value (1-7, Monday-Sunday) */ export declare const DAY_OF_WEEK: { MON: number; TUE: number; WED: number; THU: number; FRI: number; SAT: number; SUN: number; }; /** * Extract date/time parts from a Date in a specific timezone * @param date - The source Date object * @param timezone - The target timezone (e.g., 'America/New_York'). Defaults to configured timezone. * @param locale - The locale for formatting (e.g., 'en-US'). Defaults to configured locale. * @param includeTime - Whether to include time parts (hour, minute, second) * @returns Object containing the extracted date/time parts */ export declare const getDatePartsInTimezone: (date: Date, timezone?: string, locale?: string, includeTime?: boolean) => { year: string; month: string; day: string; hour?: string; minute?: string; second?: string; }; /** * Build a Date from date/time parts * @param year - Year string * @param month - Month string (2-digit) * @param day - Day string (2-digit) * @param hour - Hour string (2-digit, optional) * @param minute - Minute string (2-digit, optional) * @param second - Second string (2-digit, optional) * @returns A new Date object */ export declare const buildDateFromParts: (year: string, month: string, day: string, hour?: string, minute?: string, second?: string) => Date; /** * Convert a TimeOfDay object to a Date object * Creates a Date for today with the specified time in the target timezone. * Equivalent to: DateTime.fromObject({ hour, minute }).setZone(timezone, { keepLocalTime: true }) * * @param time - TimeOfDay object with hours and minutes * @param timezone - The target timezone (e.g., 'America/New_York'). Defaults to configured timezone. * @returns A Date object representing the time in the specified timezone */ export declare const convertTimeOfDayToDateTime: (time: TimeOfDay, timezone?: string) => Date; /** * Convert a Date to a Date adjusted for a specific timezone * This is useful when you need to display or compare dates in a specific timezone * * @param date - The source Date object * @param timezone - The target timezone (e.g., 'America/New_York'). Defaults to configured timezone. * @param locale - The locale for formatting (e.g., 'en-US'). Defaults to configured locale. * @returns A new Date object adjusted to represent the same moment in the target timezone */ export declare const convertDateToTimezone: (date: Date, timezone?: string, locale?: string) => Date; /** * Format a Date as a localized string for a specific timezone and locale * * @param date - The source Date object * @param timezone - The target timezone (e.g., 'America/New_York'). Defaults to configured timezone. * @param locale - The locale for formatting (e.g., 'en-US'). Defaults to configured locale. * @param options - Additional Intl.DateTimeFormatOptions * @returns A formatted date string */ export declare const formatDateInTimezone: (date: Date, timezone?: string, locale?: string, options?: Intl.DateTimeFormatOptions) => string; /** * Check if a time falls within a time range * * @param time - The time to check * @param range - The time range to check against * @param timeZone - The timezone for conversion. Defaults to configured timezone. * @param locale - The locale for formatting. Defaults to configured locale. * @returns True if the time is within the range */ export declare const isInTimeRange: (time: Date, range: TimeOfDayRange, timeZone?: string) => boolean; /** * Get the current day of week as a number (1-7, Monday-Sunday) * JavaScript's getDay() returns 0 (Sunday) to 6 (Saturday), * this function converts to 1 (Monday) to 7 (Sunday) * * @param date - The date to get the day of week from * @returns The day of week as a number (1-7) */ export declare const getDayOfWeekNumber: (date: Date) => number; /** * Format a date as time only (e.g., "10:30 AM") * Uses configured locale and timezone * * @param date - The date to format * @param options - Additional Intl.DateTimeFormatOptions (defaults to hour:numeric, minute:numeric) * @returns A formatted time string, or empty string if date is undefined */ export declare const formatTime: (date?: Date, options?: Intl.DateTimeFormatOptions) => string; /** * Format a time range as a localized string * If start and end times are the same, returns just the time * Otherwise returns "start - end" format * * @param startTime - The start time * @param endTime - The end time * @param options - Additional Intl.DateTimeFormatOptions (defaults to hour:numeric, minute:numeric, hour12:true) * @returns A formatted time range string */ export declare const formatTimeRange: (startTime: Date, endTime: Date, options?: Intl.DateTimeFormatOptions) => string; /** * Check if two dates are on the same calendar day * Compares year, month, and day components * * @param date1 - The first date to compare * @param date2 - The second date to compare * @returns True if both dates are on the same calendar day */ export declare const isSameDay: (date1: Date, date2: Date) => boolean; /** * Get today's date with time set to midnight (00:00:00.000) * * @returns A Date object representing the start of today */ export declare const getToday: () => Date; /** * Get a future date with time set to 23:59:59.999 * * @param days - The number of days to add to the current date * @returns A Date object representing the end of the future date */ export declare const getFutureDate: (days: number) => Date; /** * Create a Date object from year, month, and day numbers * Adjusts for timezone offset to ensure the date represents the correct local date * * @param year - The year (e.g., 2024) * @param month - The month (1-12, where 1 is January) * @param day - The day of the month (1-31) * @returns A Date object representing midnight on the specified date in local time */ export declare const createDateFromYMD: (year: number, month: number, day: number) => Date; /** * Format a Date as an ISO date string (YYYY-MM-DD) * Useful for HTML date input values and attributes * * @param date - The date to format * @returns A string in YYYY-MM-DD format */ export declare const toISODateString: (date: Date) => string;