import { GetDayjsConfig, GetDayjsReturn, NonNullableDate } from '@libs-ui/interfaces-types'; import dayjs from 'dayjs'; import 'dayjs/locale/en'; import 'dayjs/locale/vi'; /** * Thiết lập múi giờ mặc định cho hệ thống (mặc định là Asia/Ho_Chi_Minh). * @param localeZone Tên múi giờ (ví dụ: 'America/New_York') */ export declare const setDefaultTimeZone: (localeZone?: string) => void; /** * Thiết lập pattern Regex để nhận diện và chuẩn hóa các chuỗi thời gian UTC đặc biệt. * @param pattern Regex pattern dùng để kiểm tra và replace chuỗi thời gian */ export declare const setPatternCheckTimeUTC: (pattern: RegExp) => void; export type TYPE_FUNCTION_FORMAT_DATE = (time: dayjs.ConfigType, formatOutput: string, lang?: string) => string; /** * Cung cấp một hàm format tùy chỉnh ghi đè lên logic mặc định của formatDate. * @param functionCustom Hàm format tùy chỉnh */ export declare const updateFunctionFormatDate: (functionCustom: TYPE_FUNCTION_FORMAT_DATE) => void; /** * @description Lấy đối tượng dayjs theo config * @param config nếu không có config sẽ trả về đối tượng dayjs là thời gian hiện tại * @param config.date thời gian cần lấy * @param config.returnDayjsIfConfigDateNotExist true nếu muốn trả về đối tượng dayjs nếu config.date không có * @param config.utc true nếu muốn lấy thời gian UTC * @param config.formatOfDate định dạng thời gian đang được truyền vào */ export declare const getDayjs: (config?: C) => GetDayjsReturn; /** * @description Kiểm tra xem hai ngày có khác nhau không (khác ngày trong tuần) * @param date1 ngày thứ nhất cần so sánh * @param date2 ngày thứ hai cần so sánh * @returns true nếu hai ngày khác nhau, false nếu giống nhau hoặc không thể so sánh */ export declare const isDifferenceDay: (date1: NonNullableDate, date2: NonNullableDate) => boolean; /** * @description Kiểm tra xem hai ngày có khác tháng không * @param date1 ngày thứ nhất cần so sánh * @param date2 ngày thứ hai cần so sánh * @returns true nếu hai ngày khác tháng, false nếu cùng tháng hoặc không thể so sánh */ export declare const isDifferenceMonth: (date1: NonNullableDate, date2: NonNullableDate) => boolean; /** * @description Kiểm tra xem hai ngày có khác năm không * @param date1 ngày thứ nhất cần so sánh * @param date2 ngày thứ hai cần so sánh * @returns true nếu hai ngày khác năm, false nếu cùng năm hoặc không thể so sánh */ export declare const isDifferenceYear: (date1: NonNullableDate, date2: NonNullableDate) => boolean; /** * @description Lấy ra chuỗi thời gian hiển thị theo định dạng và ngôn ngữ * @param date thời gian cần định dạng * @param format định dạng thời gian muốn lấy ra * @param lang lấy theo ngôn ngữ */ export declare const formatDate: (date: dayjs.ConfigType, formatOutput?: string, lang?: string, formatInput?: string) => string;