const require_built = require('../config/dist/esm/built.cjs');
const require_intl = require('../utils/intl.cjs');

//#region ../react-intlayer/dist/esm/@intlayer/core/dist/esm/formatters/date.mjs
const presets = {
	short: {
		year: "2-digit",
		month: "2-digit",
		day: "2-digit",
		hour: "2-digit",
		minute: "2-digit"
	},
	long: {
		year: "numeric",
		month: "long",
		day: "numeric",
		hour: "numeric",
		minute: "numeric"
	},
	full: {
		year: "numeric",
		month: "long",
		day: "numeric",
		hour: "numeric",
		minute: "numeric",
		hour12: false
	},
	dateOnly: {
		year: "numeric",
		month: "short",
		day: "numeric"
	},
	timeOnly: {
		hour: "numeric",
		minute: "numeric",
		second: "numeric"
	}
};
/**
* Formats a date/time value into a localized string using Intl.DateTimeFormat.
*
* @example
* date({ date: new Date(), options: "short" });
* // "08/02/25, 14:30"
*
* @example
* date({ date: "2025-08-02T14:30:00Z", locale: Locales.FRENCH, options: { month: "long", day: "numeric" } });
* // "2 août"
*/
const date = (date$1, options) => {
	const dateTime = new Date(date$1);
	const resolvedOptions = typeof options === "string" ? presets[options] ?? {} : options;
	return new require_intl.CachedIntl.DateTimeFormat(options?.locale ?? require_built.built_default?.internationalization?.defaultLocale, resolvedOptions).format(dateTime);
};

//#endregion
exports.date = date;
//# sourceMappingURL=date.cjs.map